RE: RE: Python Tip: Dump JSON to and From a File
You are viewing a single comment's thread from:

RE: Python Tip: Dump JSON to and From a File

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()

@themarkymark: I recommend using | Ecency