Dec-17-2017, 04:11 PM
I am working on a Linux Mint 18.2 laptop.
I used python 2.7 in the past but moved to 3.5 and now 3.6. I have carried on using os.system calls as I cannot figure out the correct syntax for using subprocess calls.
Here is an example of what I am struggling with.
with os.system I can do
something like this example is fine
I tried
So I do hope someone can point me in the right direction please.
I used python 2.7 in the past but moved to 3.5 and now 3.6. I have carried on using os.system calls as I cannot figure out the correct syntax for using subprocess calls.
Here is an example of what I am struggling with.
with os.system I can do
vid = home + "/myvids/videos/" + vidstore[thevid] vid2play = "mpv --fs " + vid os.system(vid2play)i get the variable home from
from os.path import expanduser home = expanduser(~)I have no idea what can replace expanduser and try as I might I cannot find any combination of " ' , and so on which can be passed to subprocess.call which it accepts. I have googled until my eyes swap places but all the suggestions I have tried so far have failed me.
something like this example is fine
import subprocess subprocess.call(["ls", "-l"])but how can I use variables as in the os.system call?
I tried
subprocess.call('mpv', '--fs', vid)also
subprocess.call('mpv', '--fs', 'vid')along with various other combinations but get
Quote:Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/__init__.py", line 1702, in __call__
return self.func(*args)
File "./sign-songsPCC.py", line 143, in play_song
subprocess.call('mpv', '--fs', 'vid') #, 'mwbv_BSL_201712_05_r720P.mp4')
File "/usr/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.6/subprocess.py", line 609, in __init__
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer
So I do hope someone can point me in the right direction please.