#!/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)
转载于:https://blog.51cto.com/11565901/1890764