473,388 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Non Parsed Headers in Python

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
4 1248
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Luke Meyers | last post by:
So, just a little while ago I had this flash of insight. It occurred to me that, while of course in general there are very good reasons for the conventional two-file header/implementation...
2
by: Harlin Seritt | last post by:
Is there any way to fetch a website's host/version headers using Python? Thanks, Harlin
1
by: evanpmeth | last post by:
I am currently working a program that was intended to be purely JS and AJAX. Due to the cross domain access problems i have defaulted to a language I enjoy more, Python. My project consists of a...
5
by: Milos Prudek | last post by:
I perform a XML-RPC call by calling xmlrpclibBasicAuth which in turn calls xmlrpclib. This call of course sends a HTTP request with correct HTTP headers. The response is correctly parsed by...
4
by: Gary Jefferson | last post by:
My setup.py (with extension) seems to work great for build and install, but for bdist_rpm, compilation of the extension fails because some of the headers needed to build the extension aren't in the...
0
by: Jomotix | last post by:
Hey! I'm new to python and I am trying to capture Radiotap Headers and to parse them to get the mac timestamp out. So I found this for parsing radiotap headers: ...
1
by: Calvin Spealman | last post by:
I'm still on 10.4 and I'm trying to build pyOpenSSL, but I'm failing with Python.h trying to include and failing to find any of the shared libraries. I can't figure this one out because i just...
4
by: Jean-Claude Neveu | last post by:
Hello, I am writing a Python program to check email using POP3. I've tried the sample code from python.org, and it works great. In other words, the code below successfully prints out my emails....
1
by: honeymoon | last post by:
Hello to everyone!! I'm a newbie to Python and I have this problem: I have an xml document like this <root> <one> <two> <third> some text
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.