I'm attempting to make a function that writes a string to the last line in a file. However, what I currently have (below) only writes to the first line. So if I call the function more than once, it simply overwrites the first line. I'd like it to instead write the string to a new line; how would I go about this?
Snippet :
def write (self, string) :
# self.Dir is a txt file
self.File = file(self.Dir, 'w')
self.File.write(string)