Problem Statement
Which format is language-neutral and safer for untrusted data?
Explanation
JSON is a text format supported across many languages and is safe to load from untrusted sources when using standard parsers.
pickle can execute arbitrary code during loading. Never unpickle data you do not trust.
Code Solution
SolutionRead Only
import json
with open('cfg.json') as f:
cfg=json.load(f)