May-09-2018, 01:12 AM
I have this code:
it returns all files within the directory and subdirectories. How can I modify it to return the files with their full paths?
1 2 3 4 5 6 7 8 9 10 11 |
import os def scanRecurse(baseDir): for entry in os.scandir(baseDir): if entry.is_file(): yield entry.name else : yield from scanRecurse(entry.path) for i in scanRecurse( 'D:\\App Back-Ups' ): print (i) |