Alternatively, start python with the -u command line argument.

--david ascher

Noah wrote:
> 
> This is a buffering issue. Flush stdout:
> sys.stdout.flush() after every print call.
> Be sure to import sys first.
> 
> Yours,
> Noah
> 
> ----- Original Message -----
> From: "Joshua Hewitt" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 29, 2001 5:53 AM
> Subject: "Streaming" CGI output
> 
> > I was wondering how to output text to a client browser little-by-little, eg 
>something like:
> >
> > #little-by-little.cgi
> > print httpheader+'\n'
> > print 'start<br>'
> > for i in range(n):
> > time.sleep(1)
> > print (i+1)+' seconds<br>'
> >
> > If I do the above code it waits 4 seconds and then splashes all the text out 
>together, instead of little-by-little. Now, is this a
> > python thing, or do I have to play with apache configs, or http headers, or what?
> >
> > Cheers
> >
> > _______________________________________________
> > ActivePython mailing list
> > [EMAIL PROTECTED]
> > http://listserv.ActiveState.com/mailman/listinfo/activepython
> >
> 
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activepython

-- David Ascher
   ActiveState

   New! ASPN - ActiveState Programmer Network
   Essential programming tools and information
   http://www.ActiveState.com/ASPN
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to