Jan-07-2018, 08:13 PM
Hi all, first time using pygame and relatively new with Python. pygame.mixer.music.load(listofsongs[0]) causes the program to not respond and cpu goes to ~100%. I would assume it's stuck in an endless loop but I'm not sure why. Anybody know why this might be?
Also if I comment out the pygame lines the directory window doesn't close...
Thanks in advance.
Here's a snippet:
Also if I comment out the pygame lines the directory window doesn't close...
Thanks in advance.
Here's a snippet:
def directorychooser(): directory = tkFileDialog.askdirectory() os.chdir(directory) for files in os.listdir(directory): if files.endswith(".ogg"): listofsongs.append(files) pygame.mixer.init() pygame.mixer.music.load(listofsongs[0]) pygame.mixer.music.play() directorychooser()