impor shutil
for dirpath, dirnames, filenames in os.walk(source_dir): #历遍文件夹
if file in filenames:
source_path = str(dirpath) + r'/' + str(file)
shutil.copy(source_path, target_dir)
souce_dir是源文件存放的位置
file是需要复制的文件的名称
这是比较简单的版本,如果有更加简单的请各位大神指点下