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