robertvari

json read/write

May 4th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. import json
  2.  
  3. # write
  4. with open('data.json', 'w') as outfile:
  5.     json.dump(data, outfile)
  6.  
  7. # read
  8. with open('data.json') as data_file:    
  9.     data = json.load(data_file)
Advertisement
Add Comment
Please, Sign In to add comment