I\'m sure this is very simple but I\'ve been unable to get it working correctly. I need to have my main python script call another python script and pass variables from the
Finally,
I created a package for Python to solve this problem.
$ pip install guli
Guli doesn't require installing any additional PIP package.
Guli can be used to pass between different Python scripts, between many processes or at the same script. pass variables between main Process and another (Multiprocess) Process.
import guli
import multiprocessing
string = guli.GuliVariable("hello").get()
print(string) # returns empty string ""
def my_function():
''' change the value from another process '''
guli.GuliVariable("hello").setValue(4)
multiprocessing.Process(target=my_function).start()
import time
time.sleep(0.01) # delay after process to catch the update
string = guli.GuliVariable("hello").get()
print(string) # returns "success!!!"
Hope I solved the problem for many people!