Create hello.py with this content:

1
2
3
4
5
#! /usr/bin/python

print "Content-type: text/html"
print ""
print "Hello, World!"

and make it executable:

$ chmod +x hello.py

and dropped this .htaccess:

Options +ExecCGI
AddHandler cgi-script .py