I need to append to the file after nth byte without deleting the previous content.
For Example,
If I have a file containing : "Hello World"
and I seek to position(5) to write " this" I should get
"Hello this world"
Is there any mode in which I should open the file??
Currently my code replace the characters
and gives "Hello thisd"
>>> f = open("1.in",'rw+')
>>> f.seek(5)
>>> f.write(' this')
>>> f.close()
any suggestions?