How to use glob() to find files recursively?
This is what I have:
This is what I have:
I want to open a series of subfolders in a folder and find some text files and print some lines of the text files. I am using this: configfiles = glob.glob('C:/Users/sam/Desktop/file1/*.txt') But this cannot access the subfolders as well. Does anyone know how I can use the same command to access subfolders as well? Answers: … Read more
How do I count only the files in a directory? This counts the directory itself as a file: