python upload json code example
Example 1: save json to file
import json
data = {}
with open('data.txt', 'w') as outfile:
json.dump(data, outfile)
Example 2: python to json
# a Python object (dict):
x = {
"name": "John",
"age": 30,
"city": "New York"
}
# convert into JSON:
y = json.dumps(x)