I have 2 daemons, which should access the same Variable. I've created a 3rd file for global variables and each daemon can access the variable. But when one changes the variable the other one still sees the default value.
example:
glob.py
time = 0
daemon a:
import datetime
import time
import glob
while(True):
glob.time = datetime.datetime.now()
time.sleep(30)
daemon b:
import glob
while(True):
print(glob.time)
it would print 0 everytime I hope I've made my problem clear, and someone can help me. If you need some more information please feel free to ask.
threadingthis would work as expected. So I'm going to assume you are usingmultiprocessing. See sharing state between processes.