已知文本文件 data.txt 中存放了若干内容。
请编程在当前目录下产生一个相同文件的副本data_cp.txt,实现文件的拷贝功能。
f=open('data.txt','r',encoding='utf-8') new_f=open('data_cp.txt','w',encoding='utf-8') res=f.read() new_f.write(res) new_f.close() f.close()