Skip to content

Instantly share code, notes, and snippets.

@muzizongheng
Created July 18, 2013 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muzizongheng/6027204 to your computer and use it in GitHub Desktop.
Save muzizongheng/6027204 to your computer and use it in GitHub Desktop.
convert file to dictionary
#read config
input_text = open('config', "r", encoding='utf-8-sig').read()
input_json = "{%(input_text)s}" % vars()
reader = json.JSONDecoder()
config = reader.decode(input_json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment