CodePudding user response:
Change the mode of the open function to a (append mode) is ok, you write mode, first remove the content in every time they open to add, so only the last lineCodePudding user response:
To the open (' XXX. TXT ', 'a', encoding='utf-8)