Skip to content

Instantly share code, notes, and snippets.

@mahmoud
Created May 18, 2015 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahmoud/9a61b748a77ec9f0fbc4 to your computer and use it in GitHub Desktop.
Save mahmoud/9a61b748a77ec9f0fbc4 to your computer and use it in GitHub Desktop.
Quick JSON Template demo
import json
json_template = """\
{"test_list": [],
"test_obj": {"test_num": 0.0}}
"""
obj_dict = json.loads(json_template)
obj_dict['test_obj']['test_num'] = 1.0
new_json = json.dumps(obj_dict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment