Getting the output from a console command while it's been generated!

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Jan 26 22:26:09 EST 2007


"Raúl Gómez C." <nachogomez at gmail.com> escribió en el mensaje 
news:684b0a740701261905o76ca3a9av6425b88cd1c3b9fc at mail.gmail.com...

> I'm trying to make my apps more informative to the user, so I want to know
> if its possible to get the output of the execution of a console command
> while it's been generated, I mean, I want to get the output from
> commands.getstatusoutput('CMD') while CMD it's been executed and not wait
> until CMD have finished (because CMD take very long time to).

Use the subprocess module and read line by line.

-- 
Gabriel Genellina 





More information about the Python-list mailing list