python shutil模块
主要作用与拷贝文件用的。
1.shutil.copyfileobj(文件1,文件2):将文件1的数据覆盖copy给文件2。
import shutil
f1 = open("1.txt",encoding="utf-8")
f2 = open("2.txt","w",encoding="utf-8")
shutil.copyfileobj(f1,f2)
1.shutil.copyfileobj(文件1,文件2):将文件1的数据覆盖copy给文件2。
import shutil
f1 = open("1.txt",encoding="utf-8")
f2 = open("2.txt","w",encoding="utf-8")
shutil.copyfileobj(f1,f2)

![python shutil模块
[编程语言教程]](https://www.zixueka.com/wp-content/uploads/2024/01/1706715432-e571ba52c4f98b4.jpg)
