Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # unicode(folderPath) for non ascii characters in file/folder names
- # list .mkv files in folder
- movieFiles = [folderPath + "/" + i for i in os.listdir(unicode(folderPath)) if i.endswith(".mkv")]
- # does the same recursively with os.walk
- movieFiles = [os.path.join(dp, f) for dp, dn, filenames in os.walk(unicode(folderPath)) for f in filenames if
- os.path.splitext(f)[1] == '.mkv']
Advertisement
Add Comment
Please, Sign In to add comment