usr bin env python open first_file txt f1 readlines close ff open seco

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
f = open('first_file.txt', 'r')
f1 = f.readlines()
f.close()
ff = open("second_file.txt", 'r')
ff1 = ff.readlines()
ff.close()
ff = open("first_file.txt", 'w')
for f in ff1:
ff.write(f)
for f in f1:
ff.write(f)
ff.close()
f = open('first_file.txt', 'r')
f1 = f.readlines()
f.close()
f1.remove(f1[0])
f1.remove(f1[-1])
raw_input('Press any key')