Skip to content

Instantly share code, notes, and snippets.

@m3tam3re
Created July 12, 2019 09:34
Show Gist options
  • Save m3tam3re/c419f5f907d574c7cd7a0aff30775105 to your computer and use it in GitHub Desktop.
Save m3tam3re/c419f5f907d574c7cd7a0aff30775105 to your computer and use it in GitHub Desktop.
JSON Basics in Python 2 - Saving to file
with open('jsonfile.json', 'w') as file:
my_dict = {'Kopfknoten': {'Knoten1':'mein Knoten 1', 'Knoten2': 'mein Knoten 2', 'Knoten3': 'mein Knoten 3'}}
json_dict = json.dumps(my_dict, indent=4)
json.dump(json_dict, file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment