x= { "name":"John", "age":30, "city":"New York" } #x = '[{"name":"John", "age":"30", "city":"New York"}]' f=open('forfaits2.txt','w') f.write(json.dumps(x)) f.close() f=open('forfaits2.txt') #print(f.read()) g=f.read() print(g) print(type(g)) # parse x: y = json.loads(g)