Saturday, January 19, 2013

Use Python 2.7 with

In .htaccess of root directory:

AddType text/html py
AddHandler cgi-script .py

In the same .htaccess file, this Apache script hides ".py" extensions:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.py -f
RewriteRule ^(.*)$ $

For your script, you can type or

Python path:
print "Content-type: text/html\n\n";
print "";
print "CGI Test";
print "
print "Test page using Python
print "

No comments :