Monday 27 March 2017

Writing to a file (python)

     if data.find('!add') != -1:
f = open('masters.txt', 'w')
f.writelines(args, '\n')
sck.send('PRIVMSG ' + chan + ' :' + ' added' + " " + args + '\r\n')
f.close()


When I use this code it replaces the old data with the new data, how can I make it so that the new data doesnt replaced the old data but ends at the end of the file.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...