
February 25th, 2004, 06:21 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: London, England
|
|
Quote: | Originally Posted by reaper69 And if they do go with python why won't it work for me??!!!???  |
It would help if you could be more specific about exactly how it didn't work. What is the code you are trying to run? Was there an error message, either in the browser or in the server error log? Did your PC hang? Did it explode in a ball of flames?
A CGI script runs on a server and returns a chunk of data to the browser. This is usually an HTML page, which can include Javascript just like a normal HTML page. The Javascript is run on the browser, and is totally separate from the CGI script. As far as the Python script is concerned it is just sending a stream of bytes.
Here is a handy tip for CGI programming (for Python 2.2 onwards). If you add the following lines to the start of your CGI script then any exceptions that your script generates will be returned as nicely formatted HTML, with a complete traceback.
Code:
import cgitb
cgitb.enable()
You will only want to do this during development, since it is not something you will want your users to see. However you can configure the cgitb module to write the traceback to the error log instead. RTFM for more information.
Hope this helps.
Dave - The Developers' Coach
|