> I have a problem with the subprocess module. In fact I wish > that when I run the command with subprocess I can retrieve the > data immediately without waiting for the end of the command. > > import subprocess, os, sys > # Commande FFmpeg > com_1 = 'ffmpeg -i /home/user/path/in.avi -s 160x120 -ac 1 > -ar 22050 -qmin 3 -qmax 3 -y /home/user/path/out.avi' > p = [subprocess.Popen(com_1, stderr=subprocess.STDOUT, > stdout=subprocess.PIPE, shell=True).communicate()[0]]
The "communicate" method waits for the process to exit. Maybe look farther down the page for "Replacing os.popen" http://docs.python.org/library/subprocess.html Larry _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor