cgi undefined?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sun Nov 4 17:09:13 EST 2007


Tyler Smith a écrit :
> Hi,
> 
> I'm trying to learn how to use python for cgi scripting. I've got
> apache set up on my laptop, and it appears to be working correctly.
> I can run a basic cgi script that just outputs a new html page,
> without reading in any form data, so I know that the basics are ok.
> But when I try and use cgi.FieldStorage() I get the following errors
> from cgitb:
> 
> A problem occurred in a Python script. Here is the sequence of
> function calls leading up to the error, in the order they occurred. 
>  /home/tyler/public_html/cgi-bin/cgi.py
(snip)
> form undefined, cgi = <module 'cgi' from '/home/tyler/public_html/cgi-bin/cgi.py'>, cgi.FieldStorage undefined
(snip)
> AttributeError: 'module' object has no attribute 'FieldStorage'
(snip)

> What am I doing wrong?

Not paying enough attention to the error message, perhaps ? Your script 
is named cgi.py. rename it and you should be fine.



More information about the Python-list mailing list