I'm new to Python3 and I tried to use pygame library. Firstly I tried to play .mp3 file using pygame.mixer with following code:
import pygame
from pygame import mixer
mixer.init()
mixer.music.load('some.mp3')
mixer.music.play()
I tried to run this code but it just went through it and didn't do anything but showed pygame welcome message. Not even a single error. Then I tried to run this code by writing every single line in console and somehow it worked.
Similar thing happens with this code:
from pygame import *
init()
while going:
for e in event.get():
if e.type == QUIT:
going = False
if e.type == KEYDOWN:
if e.key == K_ESCAPE:
going = False
print("work")
I copied it from official pygame eventlist example and while the example runs as it's intended to it doesn't work when I use only part showed above.
What am I doing wrong here?