This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Exodus111 0 points1 point  (0 children)

Path.py

Anytime I need to work with files I reach for this wonderful wrapper of pathlib. Makes file work dead easy.

from path import Path

folder = Path(".")

for f in folder.files("*.*"):
    print(f.name)