python下列出文件夹内的文件

2020-04-08

import os

path = 'image'

filenames = os.listdir(path)
for image_file in filenames:    
    print(image_file)     
    full_file_path = image_path + "/" + image_file


注意返回数组中不是文件的完整路径,只是文件名。


联系信息

QQ:1827566828
Email: 1827566828@qq.com
Web: https://www.yynet.wang

留言