So,I am attempting to copy some text from one .txt file to another. However,when I open the second .txt file,the lines have not been written there by the program. This is the code that I'm using.
chptfile = open('v1.txt',"a+",encoding="utf-8")
chptfile.truncate(0)
chptfile.write("nee\n")
chptfile.write("een")
lines = chptfile.readlines()
chptv2 = open ('v2.txt',"a+",encoding="utf-8")
for line in lines:
chptv2.write(line)
chptv2.close()
chptfile.close()