L
Lad
How can I run external program from Python?
I use Python with XP
Thank you for help
LB
I use Python with XP
Thank you for help
LB
The subprocess module is what you want for this.Lad said:How can I run external program from Python?
I use Python with XP
Thank you for help
LB
Gary ,Gary said:The subprocess module is what you want for this.
It's got ways of running external executables as separate subprocesses,
and interacting with the subprocess and both its input and output.
Lad said:How can I run external program from Python?
I use Python with XP
Thank you for help
mpeg = "mpeg.exe -i %s codec mp3 -s 320x240 %s" % (sourcefile,
targetfile)
stdin, stdout, stderr = os.popen3(mpeg)
mpegresult = stdout.read()
mpegerrors = stderr.read()
stdin.close(); stdout.close(); stderr.close()
print ffmpegerrors
print ffmpegresult
#########
It works if the sourcefile is small but if it is large( 30MB) it does
NOT work.It hangs or the file is not converted in full.
Any advice how I should change the program?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.