Jump to content

[SOLVED]Running Python Scripts


Tobiast

Recommended Posts

I'am trying to run a Python cgi-script. In the first place I've tried running a bit complex python script, but it did not work properly, in fact the script didn't run at all. So the next step was to write a simple HelloWorld script like this one:

#!/usr/bin/python

print 'text/plain'

print

print 'Hello World!'

 

Just to test if this script could run. But no, it didn't. I got an internal server error. Do I need to install something on the webserver to get the script to run? Any solutions?

 

BTW: I saved the script in the Cgi-bin folder, and tried to run it by connecting to the adress. Typically www.yourhostname.helios.org/cgi-bin/script.cgi

 

Thanks in advance! :)

Link to comment
Share on other sites

I couldn't work my python code either, i saved my code with .py and .cgi separetely and tried to place both in public_html and cgi-bin folders. Tried to reach both username.heliohost.org and username.heliohost.org/cgi-bin/script.cgi from my browser (also named index.cgi, index.py etc.) I have used simple samples from some cgi learning sites and the tobiast's example as well with no success at all. And i set permissions to 755 with sudo chmod command properly.

 

I hope you can help me.

 

By the way it is my first cgi programming experience at all, and fairly new in python (although i have writting some simple codes for some months in my computer, i have no web experience before) I have used some other languages before but right now my goal is to improve my python and database design.

 

Thanks in advance Kaan.

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...