eolas/neuron/9445c5fd-135c-4b0b-a70c-7a6fd45d9d58/Appending_to_files_in_Python.md
2025-04-05 10:32:40 +01:00

331 B

tags created
python
file-system
procedural
Friday, October 25, 2024

Appending to files in Python

file = open("example.txt", "a")
file.write('Add something to the end of the file')
file.close()
with open("example.txt", "a"):
    file.write("Add something to the end of the file")
file.close()