Python中将一个位置的文件复制到另一个地方

import shutil
argetdir_path = 'D:\\Python\\code\\PyQt\\1_study.py'
Targetfile_path = 'D:\\Python\\code\\2_study.py'
shutil.copyfile(argetdir_path, Targetfile_path)

上面的代码是说把路径为D:\Python\code\PyQt\1_study.py的文件1_study.py复制到D:\Python\code\2_study.py的路径下面去,复制过来的文件叫2_study.py

发布了41 篇原创文章 · 获赞 13 · 访问量 6692

猜你喜欢

转载自blog.csdn.net/comli_cn/article/details/104313522