We use cookies to enhance your browsing experience.

Learn More
Back to Library
PYTHONpython

Read/Write JSON in Python

Load and dump JSON files.

import json

# Writing
data = {'name': 'John', 'age': 30}
with open('data.json', 'w') as f:
    json.dump(data, f)

# Reading
with open('data.json', 'r') as f:
    loaded = json.load(f)
python json file
25+Total Tools
Operations
4Languages
100%Privacy

We use cookies to enhance your experience and serve personalized ads.