Dave Cinege Git Repo thesaurus / e178a47
README.rst edit Dave Cinege 2 years ago
2 changed file(s) with 18 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2626 ['a', 'b', 'c', 'd']
2727
2828
29 cfgs = '''
30 prog.version(static_int) = 123
31 opt.verbose (str_to_bool) = yes
32 hi = Hello
33 '''
34 from thesauruscfg import thescfg
35 cfg = thescfg()
36 >>> cfg.parse(cfgs)
37 {'prog': {'version': 123}, 'opt': {'verbose': True}, 'hi': 'Hello'}
38
39
2940 Quick start
3041 ------------
3142 ::
2020
2121 import os
2222 import sys
23 import json
24
2325
2426 from thesauruscfg import thescfg
2527
3840
3941 print('cfg.dump()\n---')
4042 print(cfg.dump())
43 print('---')
44
45 # thesauruscfg is perfect for JSON
46 print('json.dumps()\n---')
47 print(json.dumps(cfg, indent=4, separators=(',', ': ')))
4148 print('---')
4249
4350 # abc is using the static_int() coercion method. The method not only