shutil模块 shutil.copyfileobj(src,dst):只拷贝文件内容,需要open文件:目标文件不存在时创建,存在时覆盖 shutil.copyfileobj(open('old.xml','r'), open('new.xml', 'w')) shutil.copyfle(src.dst):直接拷贝文件内容 shutil.copy(src,dst):内容 和 权限 shtuil.copy2(src,dst):内容 和 状态信息(元数据) shutil.copymode(sr…