import pygame
pygame.init()
pygame.mixer.init()
STOPPED_PLAYING = pygame.USEREVENT + 1
pygame.mixer.music.set_endevent(STOPPED_PLAYING)
pygame.mixer.music.load(r"C:\Users\user\Desktop\Пайтон\Untitled.mp3")
pygame.mixer.music.play()
while 1:
for event in pygame.event.get():
print("событие")
if STOPPED_PLAYING == event.type:
print("все")