Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [smithy@smithy-gg tmp]$ ipython
- Python 3.8.7 (default, Jan 20 2021, 00:00:00)
- Type 'copyright', 'credits' or 'license' for more information
- IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
- In [1]: import json
- In [2]: with open("1.json") as f:
- ...: data = json.load(f)
- ...:
- In [3]: data
- Out[3]:
- {'menu': {'id': 'file',
- 'value': 'File',
- 'popup': {'menuitem': [{'value': 'New', 'onclick': 'CreateNewDoc()'},
- {'value': 'Open', 'onclick': 'OpenDoc()'},
- {'value': 'Close', 'onclick': 'CloseDoc()'}]}}}
- In [4]: data["menu"]["popup"]
- Out[4]:
- {'menuitem': [{'value': 'New', 'onclick': 'CreateNewDoc()'},
- {'value': 'Open', 'onclick': 'OpenDoc()'},
- {'value': 'Close', 'onclick': 'CloseDoc()'}]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement