写一个函数获取文件夹下所有文件的绝对路径

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")

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/11246322.html