#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import shutil
src_path = "D:\python\standardtopo_withfolder"
dst_path = "D:\python\standardtopo_withoutfolder"
def mycopy(srcpath,dstpath):
if not os.path.exists(srcpath):
print "srcpath not exist!"
if not os.path.exists(dstpath):
print "dstpath not exist!"
for root,dirs,files in os.walk(srcpath,True):
for eachfile in files:
shutil.copy(os.path.join(root,eachfile),dstpath)
if __name__ == "__main__":
mycopy(src_path,dst_path)
python实现从某一文件夹子文件夹的所有文件拷贝到新文件夹中
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章