Python实现从文件夹中筛选指定的图片取出
import os
import shutil
imgs = ['a.jpg','b.jpg','c.jpg','d.jpg']
if __name__ == '__main__':
for img in imgs:
path = 'D:\\test\\images\\' + img
if os.path.exists(path):
shutil.move(path, 'D:\\test\\screen')
else:
print(img)
pass
文档信息
- 本文作者:carpe
- 本文链接:https://carpedx.com/fragment/python-filter-specified-images/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)