By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

Non Parsed Headers in Python

P: n/a
How do I make a python CGI output whilst it is still running - how do
I tell the server not to buffer the output ?

I have seen instructions for Perl, but not for python......

Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Fuzzyman <mi*****@foord.net> wrote:
How do I make a python CGI output whilst it is still running - how do
I tell the server not to buffer the output ?


I am using sys.stdout.flush() at the appropriate place of script.
It works well

--
-----------------------------------------------------------
| Radovan GarabÃ*k http://melkor.dnp.fmph.uniba.sk/~garabik/ |
| __..--^^^--..__ garabik @ kassiopeia.juls.savba.sk |
-----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
Jul 18 '05 #2

P: n/a
Fuzzyman wrote:
How do I make a python CGI output whilst it is still running - how do
I tell the server not to buffer the output ?

I have seen instructions for Perl, but not for python......


Starting your CGI script with

#!/usr/bin/env python -u

should do the trick.

-- Gerhard

Jul 18 '05 #3

P: n/a
Aha.........
I'm not sure which of these two was the right answer..... but I've
used both and it's working.

My anagram CGI now spits out the answers as it finds them - Thanks !

http://www.voidspace.xennos.com/cgi-bin/Nanagram-CGI.py
Fuzzy
Gerhard Häring <gh@ghaering.de> wrote in message news:<ma***************************************@py thon.org>...
Fuzzyman wrote:
How do I make a python CGI output whilst it is still running - how do
I tell the server not to buffer the output ?

I have seen instructions for Perl, but not for python......


Starting your CGI script with

#!/usr/bin/env python -u

should do the trick.

-- Gerhard

Jul 18 '05 #4

P: n/a
Fuzzyman wrote:

Aha.........
I'm not sure which of these two was the right answer..... but I've
used both and it's working.


Either should have worked, and now one of them is redundant. If
you don't mind using the "-u" option you can certainly save yourself
the trouble of inserting .flush() calls everywhere.

-Peter
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.