advertisement

Article:
  Web Apps with Tiger: Getting Started
Subject:   Serving a simple Python Script
Date:   2005-09-21 10:24:05
From:   b_hanna
Response to: Serving a simple Python Script

Python is cool :p. The setup is basically the same as php, mind you, you may need to enable other cgi modules to get it to run. From then on just 'import cgi' and get cracking with FieldStorage() --> gives you all the parameters passed to your CGI script. I did a lot of tail /var/log/httpd/error_log but I got it working in the end. Just a little tip, make sure the script runs before you try to run it as cgi, I wasted about half an hour wrestling with the conf file only to find I had a typo in my script!!! :-( Oh well. A good test is to manually test the script by directly putting the parameters in the URL(i.e.localhost/mypycgi.cgi?name=Ronald%McDonald) and getting python to print out the parameters, from then on your in python land and can stop sweating about the server.