Words
24
Reading
1 min
Listen
Play
5y
I recommend using context manager “with”. Helps ensure you close resources but it is also cleaner.
with open("readme.txt") as file:
data = file.read()
I recommend using context manager “with”. Helps ensure you close resources but it is also cleaner.
with open("readme.txt") as file:
data = file.read()
RE: Python Tip: Dump JSON to and From a File