I have this for example
Dict = {'Hello':'World', 'Hi':'Again'}
x = (str(Dict))
Dict2 = {x}
print (Dict2)
I understand why it doesn't work that way but i'm new to python and have no idea what i'm doing. I'd like to be able to export my dictionary to a variable (here x) and then able to fill another dictionary with it. I don't want to use the dict.copy() command, beacause the variable x will be stored on a txt file. Any help is highly appreciated. Thanks in advance.
copy
?{x}
because you need a key-val assignment in dictionaries no matter what. So try{'Dict' : x}
or something?json
.