python 第三方库os(图片)

设图片在image文件夹下,path="image/"   os.path.join(path)#image/

os.listdir(path)#['0.jpg', '1.jpg'] image下的图片名称列表

[os.path.join(path,f) for f in os.listdir(path) if f.endswith(".jpg")]#['image/0.jpg', 'image/1.jpg']

猜你喜欢

转载自blog.csdn.net/qq_15258623/article/details/81237170
今日推荐