def real_playsound():
    sound = pyglet.media.load('music.mp3')
sound.play()
pyglet.app.run()

def playsound():
    global player_thread
player_thread = Thread(target=real_playsound)
player_thread.start()
Воспроизведение музыки с помощью Pyglet и Tkinter в Python