Dec-17-2017, 06:19 PM
(Dec-17-2017, 05:59 PM)wavic Wrote: You have to pass a list to subprocess.call.
>>> import subprocess >>> import os.path >>> video = os.path.abspath("gotham.206.hdtv-lol.mp4") >>> video '/media/storage/Download/Video/Gotham.S02.HDTV.x264-Zamunda.SE/gotham.206.hdtv-lol.mp4' >>> subprocess.call(['mpv', video]) Playing: /media/storage/Download/Video/Gotham.S02.HDTV.x264-Zamunda.SE/gotham.206.hdtv-lol.mp4 (+) Video --vid=1 (*) (h264) (+) Audio --aid=1 --alang=und (*) (aac) (+) Subs --sid=1 'gotham.206.hdtv-lol.srt' (subrip) (external) [vo/opengl/x11] Disabling screensaver failed (4). Make sure the xdg-screensaver script is installed. [sub]Using subtitle charset: cp1251 AO: [pulse] 48000Hz stereo 2ch float VO: [opengl] 720x404 yuv420p AV: 00:00:16 / 00:43:48 (0%) A-V: 0.000 Dropped: 12 Cache: 10s+73MB Exiting... (Quit) 4[/sub]
So having read about how much better it it to use subprocess instead of os this seems to indicate
there is no point to using subprocess if I have to use os anyway and can't pass a variable to subprocess. I really hope there must be a way to get it to work.