Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Peter Hansen
Steve Holden wrote: Peter Hansen wrote: I suspected that too, Steve, but why would it be showing the library cgi.py in the traceback if he had a local one with the same name? Weird. (Unless, as I wondered in my redundant reply, the traceback he posted wasn't the real traceback...) It *is* a littl

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Steve Holden
Peter Hansen wrote: Steve Holden wrote: Traceback (most recent call last): File "cgi.py", line 2, in ? import cgi File "/c/steve/cgi.py", line 12, in ? main() File "/c/steve/cgi.py", line 6, in main form = cgi.FieldStorage() AttributeError: 'module' object has no attribute 'FieldS

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Ali
>1. When you tried "import cgi.py" from the interactive prompt, >was that really what you typed? Because that's not a valid >import statement for the cgi module. You should have done >"import cgi" instead. import cgi was giving me the same error, because it was importing from the cgi.pyc? >3. The

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Ali
You are right, I had first named my file cgi.py... but then i realized that it was causing conflicts so i renamed it to mycgi.py as you can see in the trace, but the problem persisted... After reading your reply i took a look at the directory i was in and there was a pyc file in it... cgi.pyc, i r

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Peter Hansen
Steve Holden wrote: Traceback (most recent call last): File "cgi.py", line 2, in ? import cgi File "/c/steve/cgi.py", line 12, in ? main() File "/c/steve/cgi.py", line 6, in main form = cgi.FieldStorage() AttributeError: 'module' object has no attribute 'FieldStorage' Ha! There's

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Peter Hansen
Ali wrote: Okay, i don't know what the problem is... I ran python in interactive mode and tried "import cgi.py" and i got the same error... Any ideas? Probably nothing really helpful, I'm afraid. Still, try these ones out: 1. When you tried "import cgi.py" from the interactive prompt, was that r

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Steve Holden
Ali wrote: > Hello all, > > I have got a very simple python code: > ___ > > #!/usr/bin/python > import cgi > > def main(): > print "Content-type: text/html\n" > form = cgi.FieldStorage() > if form.has_key("firstname") and form["firstname"].value != "": > print "Hello", form[

Re: Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Ali
Okay, i don't know what the problem is... I ran python in interactive mode and tried "import cgi.py" and i got the same error... Any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Newbie: A very basic problem related to cgi.py

2004-12-20 Thread Ali
Hello all, I have got a very simple python code: ___ #!/usr/bin/python import cgi def main(): print "Content-type: text/html\n" form = cgi.FieldStorage() if form.has_key("firstname") and form["firstname"].value != "": print "Hello", form["firstname"].value, "" else: print