Python 批量读取文件夹下的图片,并保存在文档下
#!/usr/bin/env python #-*- coding:UTF-8 -*- import os ''' edited by zr date:2017.05.27 ''' path ='/home/zr/5-11-images/fuyangben/' f=open("all.txt",'w') for pic in os.listdir(path): f.write(os.path.join(path,pic)+'\n') f.close()
结果是:
posted on 2017-05-27 15:55 xiaoheizi 阅读(1874) 评论(0) 编辑 收藏 举报