Here is an example of my directory:
Auto
├── Test
│ └── Test.csv
├── Test2
│ └── Test2.csv
└── new.csv
I am trying to read all the csv files in the directory.
Here is my code:
import glob, os
os.chdir('C:\\Users\\Me\\Desktop\\Auto')
for file in glob.iglob('*.csv'):
print(file)
This only prints “new.csv” and not “Test.csv” or “Test2.csv”.
I was thinking maybe I could try the directory name as the following:
os.chdir('C:\\Users\\Me\\Desktop\\Auto\\{}')
But, this gives me a FileNotFoundFoundError as the system cannot find the directory specified.