Python JSON Read Write Example

PYTHON 2 weeks ago 725 views
S

sujeetkumar713

21 public snippets
725 Views
0 Comments
0 Saves

Description

Python JSON read and write example for beginners.
Python JSON Read Write Example.py
import json

data={'name':'John','age':30}

with open('file.json','w') as f:
    json.dump(data,f)

with open('file.json') as f:
    print(json.load(f))

Comments (0)

Add Comment

No comments yet. Be the first to comment!