I have a file which I am monitoring, since I need two fields from it, the thing is that I have run into the problem that with the multithreading library I cannot share global variables, that is, I modify them in the main and in the processes they do not come out those modifications, I've been investigating and I can't find a solution. The child processes that you have running must see in real time that modification that was made in the main
WH = ''
delay = 0.0
def comprobar():
print(WH)
print(delay)
if __name__ == "__main__":
while True:
with open("configUsers.json") as archivo:
data = json.load(archivo)
WH = data['WH']
delay = data['delay']
thread = multiprocessing.Process(name="hilo1", target=comprobar, args=())
thread.start()
time.sleep(0.5)