Jump to content

Recommended Posts

Posted

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
Posted

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.

Posted

Can you post the script here ?

 

Also, have you added the content/type header ? Also, a syntax error in Python can cause this error.

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...