Skip to content

Instantly share code, notes, and snippets.

@roramirez
Created October 26, 2016 20:41
Show Gist options
  • Save roramirez/6491c1c3e46e45df03f3116ee0618f0a to your computer and use it in GitHub Desktop.
Save roramirez/6491c1c3e46e45df03f3116ee0618f0a to your computer and use it in GitHub Desktop.
# remove double quote from json from a dict
import json, re
data = {'example': 1, "other" : {'other_key': "String", 'key_b': False}}
config = json.dumps(data)
vars = re.sub(r'"([a-zA-Z_]+)":', r'\1:', config)
print(vars)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment