Time:10-22
CodePudding user response:
The import OS OS. Listdir (" D:/folder ")
Quote: reference at the 1st floor response: The import OS OS. Listdir (" D:/folder ") Number and give the parent id?
for root, dirs, files in OS. Walk "D: \ test" (r) : For file in files: # get owning directory file Print (root) # file path Print (OS) path) join (root, file))
for root, dirs, files in OS. Walk "D: \ test" (r) : For dir in dirs: # for directory name Print (dir) # for directory path Print (OS) path) join (root, dir))
Page link:https//www.codepudding.com/other/70503.html