Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pathlib import Path
- import re
- PATTERN = re.compile(r'^\d{4}-\d{2}-\d{2}')
- WORKDIR = Path.home()
- MEDIA = WORKDIR / 'Downloads'
- for file in MEDIA.iterdir():
- if file.is_file() and PATTERN.search(str(file.name)):
- print(file.name, 'found')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement