Jan-25-2024, 02:50 PM
Hello,
Apparently, subprocess is currently the solution du jour to run an external application from Python 3.12.
For some reason, output is returned through stderr instead of stdout:
What am I doing wrong?
Thank you.
Apparently, subprocess is currently the solution du jour to run an external application from Python 3.12.
For some reason, output is returned through stderr instead of stdout:
1 2 3 4 5 6 7 8 9 10 |
import subprocess import sys import os os.chdir(r 'c:\temp' ) p = run( [ r 'c:\ffprobe.exe' , '-hide_banner' ,r "input.mp4" ], shell = True ,capture_output = True ,text = True , check = True ) #!!! outputs to stderr!!! print ( 'stdout:' , p.stdout) #nothing print ( 'stderr:' , p.stderr) |
Thank you.