Jul-11-2019, 05:02 AM
can any body explain why this didn't work
#test1.py var=99 def glob3(): var=0 import sys glob=sys.modules['test1'] glob.var+=1 glob3() print(var) #python report an errorBut when i import that test1 module in interactive prompt, it worked:
>>> import test1 100