播放音乐,需要安装playsound这个第三方库。
pip install playsound
from playsound import playsound playsound('audio.mp3')
程序中的audio.mp3文件,可以换成自己的音频文件。运行程序,即可播放。