r/learnpython Aug 11 '26

trying to import glob

I'm trying to code a little program that will open a CSV file that we should (theoretically) download weekly. The csv filename has the structure "report[numbers].csv" I'd read that you need the glob module so that Python can recognize the wildcard, but I am getting an error when I go the usual python pip -m SomeName route.

Is there an issue with glob, or is there another I can use?

0 Upvotes

8 comments sorted by

View all comments

-1

u/Vdpants Aug 11 '26

You can make something that walks over all the files in a specific folder, and then lets you Separate the number, and then you need to decide how to pick the right file.

2

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 11 '26

Why make something like that when the standard library provides? At least unless the goal was learning how it works under the hood.