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)
Le code ci-dessus consiste à copier le fichier 1_study.py dont le chemin est D: \ Python \ code \ PyQt \ 1_study.py vers le chemin de D: \ Python \ code \ 2_study.py, et le fichier copié est appelé 2_study.py