Re: Pyglet help
Sub folders would probably take something like os.walk or a tree crawler, but for parsing files you can use os.listdir with os.scandir for current directories.
import os.path
import glob
types = [".mp3", ".wav", ".flac", ".mp4", ".mpg", ".avi", ".m4a"]
types = str(types)
path = input("Enter the path to your music folder.") box = os.listdir(path) print(box) #list audio files for a in box: if a[-4:] in types: print(a) if a[-5:] == '.flac': print(a) #list directories with os.scandir(path) as it: for entry in it: if not entry.name.startswith('.') and entry.is_dir(): print(entry.name)
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector