I need to load 1460 files into a list, from a folder with 163.360 files.
I use the following python code to do this:
import os
import glob
Directory = 'C:\\Users\\Nicolai\\Desktop\\sealev\\dkss_all'
stationName = '20002'
filenames = glob.glob("dkss."+stationName+"*")
This has been running fine so far, but today when I booted my machine and ran the code it was just stuck on the last line. I tried to reboot, and it didn't help, in the end I just let it run, went to lunch break, came back and it was finished. It took 45 minutes. Now when I run it it takes less than a second, what is going on? Is this a cache thing? How can I prevent having to wait 45 minutes again? Any explanations would be much appreciated.