Dave Cinege Git Repo thesaurus / 58c92e8
Added json.loads() example in thesauruscfg_sample.py Dave Cinege 2 years ago
1 changed file(s) with 8 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1616 ###
1717 from __future__ import print_function
1818
19 __VERSION__ = (2, 9, 0, 20191113)
19 __VERSION__ = (2, 9, 0, 20200108)
2020
2121 import os
2222 import sys
4545
4646 # thesauruscfg is perfect for JSON
4747 print('json.dumps()\n---')
48 print(json.dumps(cfg, indent=4, separators=(',', ': ')))
48 js = json.dumps(cfg, indent=4, separators=(',', ': '))
49 print(js)
50 print('---')
51
52 print('cfg_json = json.loads(), cfg_json.print_tree()\n---')
53 cfg_json = json.loads(js, object_hook=thescfg)
54 cfg_json.print_tree()
4955 print('---')
5056
5157 # abc is using the static_int() coercion method. The method not only