Write a function to get the absolute path of the folder and all files

 

import os
def s(path):
    file_list=os.listdir(path)
    for file in file_list:
        print(os.path.realpath(file))

Export

s("/Users/xiangyong/PycharmProjects/11-13")

 

Guess you like

Origin www.cnblogs.com/sea-stream/p/11246322.html