You can use 'a' in the open() function to open a file in append mode. Check the below example.
with open("myfile", "a") as fl: fl.write("your data")
with open("myfile", "a") as fl:
fl.write("your data")