Hacker News new | ask | show | jobs
by cuchoi 2379 days ago
I like glob for getting the list of files:

    import glob
    list_of_files = glob.glob("*.csv")
You can also use Pathlib:

    from pathlib import Path
    dir = Path(".").glob('*.csv')
1 comments

Glob is great but on some OS (Linux maybe?) it doesn't guarantee maintaining the order of files. If order matters, it would make sense to sort the results prior to processing.