Discuss / Python / walk最方便

walk最方便

Topic source

for root, dirs, files in os.walk(path):

for file in files:
if target_str in file:
        print(os.path.join(root, file))

排版太烂了

for root, dirs, files in os.walk(path):

    for file in files:

        if target_str in file:

            print(os.path.join(root, file))


  • 1

Reply