Output from a CGI whilst running

Fuzzyman michael at foord.net
Mon Feb 9 10:32:53 CET 2004


I've written an an anagram generator.

(The desktop version is available for download from
http://www.voidspace.org.uk/atlantibots/nanagram.html !!)

The CGI version is at :
http://www.voidspace.xennos.com/nanagram-CGI.html

Although I had it working before - I think it needs tweaking again...
:-(

Anyway - all that is more or less irrelevant (isn't most of USENET ?)
- what I need to know is - how do I force the server to allow output
from the script *before* the script has finished outputting ?

The script sometimes takes a while to finish and I'd like it to
display results as it finds them, rather than waiting until I'd find
them all..........

The closest I could find was : (which of course is for Perl)

http://www.n3t.net/Programming/

For forcing a script to use Non Parsed Headers (for Apache only), use
this at the begining
of your script.
**note - this will let the cgi display it's output while running,
rather than waiting for the
whole thing to finish. 

#!/usr/bin/perl
$| = 1;
print "$ENV{'SERVER_PROTOCOL'} 200 OK\n";
print "Server: $ENV{'SERVER_SOFTWARE'}\n";
print "Content-type: text/html\n\n";


Anyone know the way to achieve the same result under python ??

Fuzzyman

http://www.voidspace.org.uk/atlantibots/pythonutils.html



More information about the Python-list mailing list