[Solved] I can not transform a file to a dictionary in python [duplicate]

[ad_1]

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

[ad_2]

solved I can not transform a file to a dictionary in python [duplicate]