Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # t_find_by_extensions.py
- from tkFileDialog import askdirectory
- folder = askdirectory() # needs to be placed after pack()
- import os
- filenames = os.listdir(folder)
- print(folder)
- print
- extensions = '.jpg .jpeg .png'.split()
- for file in filenames:
- if any([file.endswith(z) for z in extensions]):
- print('***\t\t'+file)
- else:
- print(file)
Add Comment
Please, Sign In to add comment