Use Json library:
To save dict into file
with open("your_file") as f:
f.write(json.dumps(your_dict))
To load dict from file
with open("your_file") as f:
d = json.load(f)
0
solved I can not transform a file to a dictionary in python [duplicate]