我将歌曲名称传递给函数,但无法为 omxplayer 构建路径
def PlayMusic(song):
#check if the process exists
is_pid = subprocess.call("pidof omxplayer.bin > /dev/null", shell=True)
if is_pid == 0:
return musicplaying("Song already Playing")
else:
pathsong ='/home/pi/'+song
os.system('omxplayer --no-keys -o local pathsong &')
return musicplaying (song +" playing")
如何将“pathsong”放入 omxplayer 命令行?