В чем здесь проблема? Теперь я сделал два файла и вставил их. Почему он не копирует f в y?
f=open('test.dat,''w')
f.write("now is the time")
f.write("to close the file")
f.close()
def copyfile(oldfile,newfile):
f1=open(oldfile,"r")
f2=open(newfile,'w')
while 1:
text=f1.read(5)
if text == "":
break
f2.write(text)
f1.close()
f2.close()
return
y=open('test,datt',"w")
f=open('test,dat','r')
copyfile(f,y)
Подробнее здесь: https://stackoverflow.com/questions/786 ... opy-f-in-y