I have a simple hello world python script:
#!/usr/bin/python
print "Content-Type: text/html"
print
print """\
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>
"""
I uploaded it to my server, which has python installed, yet when I visit it in the browser by hitting http://myserver.foo/script.py , I see the script in it’s entirety in the browser window. Am I doing something wrong? I want to just see ‘Hello World!’…
Stupid (but mandatory) questions:
1. Do you have this in either your
conffile or an.htaccess(assuming Apache)?2. Have you
chmod‘d the file to755?3. Is Python at
/usr/bin/python? (It could beC:\Python32\python.exe)Some notes:
#!/usr/bin/env pythoninstead of#!/usr/bin/python. It is more error-proof.