@timeit
def copy(sourcefile,destfile):
with open(sourcefile) as f1:
content = f1.read()
with open(destfile,'w') as f2:
f2.write(content)
@timeit
def copy1(sourcefile,destfile):
with open(sourcefile) as f1,open(destfile,'w')as f2:
# for line in f1:
# f2.write(line)
f2.write(f1.read())
copy('data.txt','data_1.txt')
copy1('data.txt','data_2.txt')