31-拷贝文件
作者:互联网
每次读取4K,读完为止:
src_f1 = './test1.html'
dst_f2 = './test2.html'
src_fobj = open(src_f1,'rb')
dst_fobj = open(dst_f2,'wb')
while True:
data = src_fobj.read(4096)
if not data:
break
dst_fobj.write(data)
src_fobj.close()
dst_fobj.close()
标签:文件,f2,src,31,f1,fobj,拷贝,data,dst 来源: https://www.cnblogs.com/hejianping/p/10875507.html