On Apr 6, 3:59 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote:
> "ianaré" <[EMAIL PROTECTED]> writes:
> > hey all, I'm trying to get real time updates of batch file output.
>
> [...]
>
> > So I tried subprocess:
> > proc = subprocess.Popen('"C:/path/to/test.bat"', bufsize=0,
> >   stdout=subprocess.PIPE)
>
> Instead of that:
>
> > for line in proc.stdout:
> >     self.display.WriteText(line)
>
> try that:
>
> while True:
>     line = proc.stdout.readline()
>     if not line: break
>     self.display.WriteText(line)
>
> When a file is used in a for loop it works like an iterator.
> You can read details here (description of method 
> ``next``):http://docs.python.org/lib/bltin-file-objects.html
>
> --
> HTH,
> Rob

Rob, you are the man =) thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to