Jump to content

Python Not Working?


leonardodcrapio

Recommended Posts

This might help: http://www.heliohost.org/home/features/languages/python

 

Also, if you could post your script, so that we can come to know the problems.

 

Also, they should be kept in the cgi-bin directory to be executed.

Python scripts are easy to configure and run. Just create a file in your cgi-bin directory under public_html, and place the Python "shebang" line (#!/usr/bin/python) on the first line of the file. Below this line you may write Python code. Make sure you make this file's CHMOD permissions 755, and output a Content-type header before anything else.

  • Like 1
Link to comment
Share on other sites

I just moved the script to /cgi-bin/ and added the shebang line. The script is located at: closedgw.heliohost.org/cgi-bin/test.py and the index page is present when you go to closedgw.heliohost.org.

 

I am still not getting the expected results. Which is the printing of number 1-10.

Link to comment
Share on other sites

script:

#!/usr/bin/python

print "Content-type: text/html"

print "Python code is working"

 

Excuse my ignorance but I don't understand your second question. It has been a long time since I have messed around with a website.

 

edit: I modified the script to print the string, "Python code is working". So, it should no longer print 1-10.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...