1
我想用多個參數執行os.system()
命令。如何用多個參數執行os.system()
def playmp3(SongName, Freqency):
os.system("sox -t mp3", SongName, "-t wav - | sudo pifmrds -freq", Freqency, "-audio", SongName)
但我總是得到這樣的錯誤:
>>> playmp3("/home/pi/music/hit_the_street2.wav", "105")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in playmp3
TypeError: system() takes exactly 1 argument (6 given)