Let's imagine i have a program in Python like this one (first.py):
GLOBALVAR = "pineapple"
def changeVAR(newValue):
global GLOBALVAR
GLOBALVAR = newValue
while(True):
print GLOBALVAR
And i want to chante the global variable GLOBALVAR with another python program while the first is running. For instance (second.py):
from second import changeVAR
#do something
first.changeVAR("banana")
Is it possible to do something like this? Meaning, to change a global variable of a running program with another program?
Thank you in advance!