En Tue, 06 Feb 2007 16:44:52 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió:
> On Feb 6, 2:02 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On 6 Feb 2007 07:37:33 -0800, "[EMAIL PROTECTED]" >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> >> > Everything works fine until I call the popen function, then it >> > freezes. What I want is to print the output in real time, just like >> > it does when I run it from a shell. >> >> And you want /this/ in a web page? >> >> I don't think HTTP is designed for that... As I understand it, >> it >> expects to get a complete page back and then the transaction is complete >> and forgotten (except for the presence of session cookies). To report If the response does not include a Content-Length header, and has a Transfer-Encoding: chunked header, then it is sent in chunks (blocks) and the client is able to process it piece by piece. See the server docs on how to enable and generate a chunked response. On Zope 2, by example, it's enough to use response.write(). > Web pages can show output as it's sent. For testing I created a > script on the server that untars a 600 meg volume, I can see each file > name show up in my browser instantly, just like it should. The other > script I'm trying to run won't show anything until the entire process > is complete and it's just a bunch of echo statements in a for loop, > I'm not sure why they behave differently. Are you sure the other process is executing? and not buffered? and you're reading its output line by line? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list