Skip to content

Instantly share code, notes, and snippets.

@luisenriquecorona
Last active February 25, 2020 21:06
Show Gist options
  • Select an option

  • Save luisenriquecorona/8ce9c0e403bafab4408ba060bc277de1 to your computer and use it in GitHub Desktop.

Select an option

Save luisenriquecorona/8ce9c0e403bafab4408ba060bc277de1 to your computer and use it in GitHub Desktop.
JSON is a newer and emerging data interchange format, which is both programming-language-neutral and supported by a variety of systems.
>>> json.dump(rec, fp=open('testjson.txt', 'w'), indent=4)
>>> print(open('testjson.txt').read())
{
"job": [
"dev",
"mgr"
],
"name": {
"last": "Smith",
"first": "Bob"
},
"age": 40.5
}
>>> P = json.load(open('testjson.txt'))
>>> P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment