今日、Python の学習を開始しました。モジュールの最初の例は、playsound モジュールで、私のコードでは機能しません。誰かが私を助けてくれますか?
コード:
from playsound import playsound
playsound('E:\Python\Chapter 1\music.mp3')
エラー:
PS E:\Python\Chapter 1> & C:/Users/EIC/AppData/Local/Programs/Python/Python310/python.exe "e:/Python/Chapter 1/pracSetQ3.py"
Traceback (most recent call last):
File "e:\Python\Chapter 1\pracSetQ3.py", line 2, in <module>
playsound('E:\Python\Chapter 1\music.mp3')
File "C:\Users\EIC\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 35, in _playsoundWin
winCommand('open "' + sound + '" alias', alias)
File "C:\Users\EIC\AppData\Local\Programs\Python\Python310\lib\site-packages\playsound.py", line 31, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 277 for command:
open "E:\Python\Chapter 1\music.mp3" alias playsound_0.5643776315006501
A problem occurred in initializing MCI.