Advertisement
nightcrow100

Untitled

Jul 2nd, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import json
  2.  
  3.  
  4. with open("birthday.json", "rb") as handle:
  5.     family = json.load(handle)
  6. print type(family)
  7.  
  8.  
  9. key = raw_input("key: ")
  10. value = raw_input("Value: ")
  11.  
  12. family[key] = value
  13. print family
  14.  
  15.  
  16. print type(family)
  17.  
  18.  
  19. with open("birthday.json", "wb") as handle:
  20.     json.dump(family, handle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement