How can I search sub-folders using glob.glob module?

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