
February 26th, 2003, 10:03 AM
|
 |
Wacky hack
|
|
Join Date: Apr 2001
Location: London, England
Posts: 513
Time spent in forums: 1 h 38 m 37 sec
Reputation Power: 13
|
|
|
getting output from command that isn't STDIN
hullo,
I need to get the output from mencoder as it encodes videos. Most of it can be retrieved easily enough, but after the initial blurb, it then displays a progress meter with various information including percentage complete, and that stays on the same line, if you get me, like wget's progress meter.
That lien doesn't get picked up through STDTIN or STDERR... I only get the last time that line is refreshed (when it's done) which isn't much use. How can I grab this output?
The code atm is like this:
PHP Code:
pipe = popen(command)
while 1:
line = pipe.readline()
if line == '':
break
print line
|