从文件夹里抽取’.jpg’
# -*- coding:utf-8 -*-
import os
import shutil
Opath = '/源文件路径/'
Tpath = '/文件保存路径/'
for m, n, files in os.walk(Opath):
for file in files:
name, extension = os.path.splitext(file)
if extension == '.jpg':
shutil.copyfile(Opath+file, Tpath+file)