import os
import pygame
from tkinter.filedialog import askdirectory
from mutagen.id3 import ID3
from tkinter import*
from PIL import ImageTk
root = Tk()
root.minsize(300,300)
root.wm_title("Miusic player ")
问题在于,当我运行代码时,它会说"无法打开音轨"。
def filechooser():
file = os.listdir("/home/pi/Desktop/project/miusic/Pendulum/Propane Nightmares")
for files in file:
if files.endswith(".mp3"):
listofmaltesesongs.append(files)
print(files)
pygame.mixer.init()
pygame.mixer.music.load(listofmaltesesongs[0])
pygame.mixer.music.play()
filechooser()
root.mainloop()