Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x= {
- "name":"John", "age":30, "city":"New York"
- }
- #x = '[{"name":"John", "age":"30", "city":"New York"}]'
- f=open('forfaits2.txt','w')
- f.write(json.dumps(x))
- f.close()
- f=open('forfaits2.txt')
- #print(f.read())
- g=f.read()
- print(g)
- print(type(g))
- # parse x:
- y = json.loads(g)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement