Catching subprocess stdout stream

Fredrik Lundh fredrik at pythonware.com
Wed Sep 10 07:13:46 EDT 2008


Sean DiZazzo wrote:

> while aThread.isAlive() or not aQueue.empty():
>    l = aQueue.get().rstrip()
>    fo.write(l)
>    print l
> 
> fo.close()
> 
> A bit of fun for a sleepless night...

and unless you add a call to time.sleep somewhere in that loop, you'll 
keep your CPU up all night as well...

</F>




More information about the Python-list mailing list