Retrieving data from a file

suggest change

The following snippet opens a JSON encoded file (replace filename with the actual name of the file) and returns the object that is stored in the file.

import json

with open(filename, 'r') as f:
    d = json.load(f)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents