copy contect from file tot other file python

Solutions on MaxInterview for copy contect from file tot other file python by the best coders in the world

showing results for - "copy contect from file tot other file python"
Matías
28 Feb 2018
1# open both files 
2with open('first.txt','r') as firstfile, open('second.txt','a') as secondfile: 
3      
4    # read content from first file 
5    for line in firstfile: 
6               
7             # write content to second file 
8             secondfile.write(line)
9