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
// This is a simple example how you can get data from the GraphQL endpoint of | |
// your Shopify store. | |
// For the explanatory article please visit: | |
package main | |
import ( | |
"bytes" | |
"io/ioutil" | |
"fmt" |
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
dict_items([('Kopfknoten', {'Knoten1': 'mein Knoten 1', 'Knoten2': 'mein Knoten 2', 'Knoten3': 'mein Knoten 3'})]) |
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', 'r') as file: | |
json_dict = json.load(file) | |
my_dict = json.load(json_dict) | |
print(my_dict.items() |
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) |
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
{ | |
"Kopfknoten": { | |
"Knoten1": "mein Knoten 1", | |
"Knoten2": "mein Knoten 2", | |
"Knoten3": "mein Knoten 3" | |
} | |
} |
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
import json ... | |
my_dict = {'Kopfknoten': {'Knoten1':'mein Knoten 1', 'Knoten2': 'mein Knoten 2', 'Knoten3': 'mein Knoten 3'}} | |
json_dict = json.dumps(my_dict, indent=4) | |
print(json_dict) |