Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 333 Bytes

69.md

File metadata and controls

16 lines (11 loc) · 333 Bytes
rank vote view answer url
69 1236 1278128 7 url

如何增加文件的内容?

如何做到 append 文件而不是覆盖?


with open("test.txt", "a") as myfile:
    myfile.write("appended text")