Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 216 Bytes

20220904164101.md

File metadata and controls

10 lines (7 loc) · 216 Bytes

pathlib list files in directory

You can use .glob() with a regular expression. Here we also turn it into a generator:

def get_notes(notes_dir):
    yield from notes_dir.glob("*.md")

#pathlib #generators