📖 Beginning Python Programming
/
Files Operation
/
Reading and writing files
Writing plain text file
with open('diary.txt', "a") as file_obj:
file_obj.write("Hello Plain Text.\n")
There are 3 modes when we open file in Python.
- a—append
- w—write with overwrite
- r—read