KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I try to raise an error if the user enter a duplicate key in a dictionary. The dictionary is in a file and the user can edit the file manually. Example: dico= {'root':{ 'a':{'some_key':'value',...}, 'b':{'some_key':'value',...}, 'c':{'some_key':'value',...}, ... 'a':{'some_key':'value',...}, } } the new key 'a' already exist... How can I test dico and warn the user when I load dico from the file?
Tags (comma-separated)
Save Edits
Cancel