Created
July 12, 2019 09:34
-
-
Save m3tam3re/c419f5f907d574c7cd7a0aff30775105 to your computer and use it in GitHub Desktop.
JSON Basics in Python 2 - Saving to file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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