hello.py

Download: source code

This is the CGI/Python equivalent of "Hello, World!". If your domain host supports CGI and Python, you can upload the Python code to your server, set the permissions to allow execution, and then link to the script.


#!/usr/bin/python

print 'Content-Type: text/html'
print
print '<html>'
print '<head><title>Hello from Python</title></head>'
print '<body>'
print '<h2>Hello from Python</h2>'
print '</body></html>'


Results

Follow this link to test hello.py: test


Maintained by John Loomis, updated Fri Jan 25 21:05:55 2008