Published
- 1 min read
python glob for all files in folder
The solution for this is noted below
python glob for all files in folder
Solution
# You can use glob:
import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
print(file)
Try other methods by searching on the site. That is if this doesn’t work