I have a python object which I dump to json and write to a file.
results = [
{'destination': (x,y), 'id': 'dsss', 'origin': (x,r), 'waypoints': [[s,l],[d,s]]},
{'destination': (x1, y1), 'id': 'ddsdsee', 'origin': (z,f), 'waypoints': [[e,y],[d,e]]}]
with gzip.open("test.json.gz",'w') as outfile:
json.dump(results,outfile,indent=2)
I then open the file elsewhere, via:
schedule_f = gzip.open("test.json.gz")
schedule = json.load(schedule_f)
pprint(schedule[0]) return:
{'destination': [x,y], 'id': 'dsss', 'origin': [x,r], 'waypoints': [[s,l],[d,s]]
Why are origin and destination fields converted to a list? I clearly specified ( and not [
resultsis missing a closing}.