14 lines
239 B
Python
14 lines
239 B
Python
|
import json
|
||
|
import pprint
|
||
|
import sys
|
||
|
|
||
|
import tomlkit
|
||
|
|
||
|
with open(sys.argv[1], encoding='utf-8', mode='r') as f:
|
||
|
if sys.argv[2] == 'parse':
|
||
|
a = tomlkit.load(f)
|
||
|
else:
|
||
|
a = json.load(f)
|
||
|
print(a)
|
||
|
pprint.pprint(a)
|