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