my_file.txt
file = open("my_file.txt")
content = file.read()
print(content)
file.close()
with open("my_file.txt") as file:
contents = file.read()
print(contents)
#Write
with open("my_file.txt", mode="w") as file:
file.write("New text.")
#Append
with open("my_file.txt", mode="a") as file:
file.write("\\nNew text.")
*When you try to open a file in write mode and that file doesn't exist, then it's going to actually create it for you from scratch.