How do you append to the file instead of overwriting it? Is there a special function that appends to the file?

Answer

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

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Scroll Up