With the following command, it prints ‘640×360’
>>> command = subprocess.call(['mediainfo', '--Inform=Video;%Width%x%Height%',
'/Users/Desktop/1video.mp4'])
640x360
How would I set a variable equal to the string of the output, so I can get x='640x360'? Thank you.
If you’re using 2.7, you can use subprocess.check_output():
If not: