I have a little code at the bottom of my program that is supposed to add a text header to the beginning of my text file. The data writes to the bottom of the file. I was reading in 'Learn Python The Hard Way' that .seek(0) would put the insertion point at the beginning, which is at the location of 0 bytes. However, I must be implementing the function incorrectly.
print 'Now, I will write a header to the original file to display copyright.'
append_copy = open(filename, "a+")
append_copy.seek(0)
append_copy.write("Copyright -- Ryan -- 2014\n")
append_copy.close()
print 'File closed and data written!'