Home > other >  Why save text only save the content of the last line of success?
Why save text only save the content of the last line of success?

Time:09-24

Please help eldest brother, the younger brother can't,

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 line

CodePudding user response:

To the open (' XXX. TXT ', 'a', encoding='utf-8)
  • Related