I have a file and I want to add some lines to the file without overriding the lines that are already present in the file......
Any help will get me out of this problem......
# Open a file with access mode 'a'
file_object = open('sample.txt', 'a')
# Append 'hello' at the end of file
file_object.write('hello')
# Close the file
file_object.close()
A short way:
More: www.tutorialspoint.com