0
我傳遞一個歌曲名稱的功能,無法管理,構建路徑omxplayer傳遞歌曲的名字在Python
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")
到omxplayer我怎麼把「pathsong」到omxplayer命令行?