The following assign.py should send the value correctly to class1.py. However, the printing return 0.0. I made dict as a static so I can assign to it from outside file. Am I missing something?
class1.py
class Class1():
dict = {}
def set_dictionary(x,y,z):
if (x, y) not in Class.dict:
Class1.dict[(x, y)] = 0.0
Class1.dict[(x,y)] = z
print ("(%s --> %s) = %s" % (x,y,z))
assign.py
import class1 as cnt
cnt.Class1.set_dictionary('s1','s2', 100)