I tried importing that dictionary into all the modules ,but changes made by each module to that dictionary is not reflected in other modules,
How can I maintain a common dictionary so that all the modules access it
file2.py
from collections import *
database=defaultdict(dict)
if __name__=="__main__":
print database[1]["plug"]
file1.py
from file2 import database
database[1]["plug"]="xyz"
print database[1]["plug"]
i tried executing file1.py and then ran file2 it shows keyerror:no plug is found. all the changes made in file1.py are lost