CGI module problem: duplicated output

Jørgen Cederberg jorgencederberg at hotmail.com
Mon Jan 12 04:09:57 EST 2004


Mimal wrote:
>> Pardon me for saying so, but I don't believe you.  Your script must
>> actually look like this:
> 
> 
> Pardon me too, but I know what my script looks like. I'm not such a 
> fool! I've tested this script under Windows NT + Python 2.1 and Windows 
> XP + Python 2.3 with the same result.
> 
> To prove you, I copied YOUR code and pasted to *.py file. Than I made it 
> executable and run it using console (./cgi.py). This is what it showed:
> 
> <html>Hello, world!</html>
> Content-type: text/html
> 
> <html>Hello, world!</html>
> <html>Hello, world!</html>
> Content-type: text/html
> 
> <html>Hello, world!</html>
> 
> I know it's very strange. I don't get it and that's why I need help. :-)
> 

No it is not strange. What you didn't mention in your first posting is 
that you named your file cgi.py. Thus, when you run your script, you 
start of by importing it, and therefore the messages are printed twice.

How about renaming it to mimal_cgi.py!

Regards
Jorgen




More information about the Python-list mailing list