import os def s(path): file_list=os.listdir(path) for file in file_list: print(os.path.realpath(file))
输出
s("/Users/xiangyong/PycharmProjects/11-13")
写一个函数获取文件夹下所有文件的绝对路径
原文:https://www.cnblogs.com/sea-stream/p/11246322.html