I have two different processes.
- Generator.py: create some data and dump to disk
- Control.py: Control script from where I can call Generator.py using subprocess.
What I am trying to achieve is that Control.py can receive the output of Generator.py without dumping it output to disk. I want to establish communication in such a way that Control.py can get data in memory from Generator.py.
Scenario is this:
Generator.py
def foo():
myList = [1,2,3]
return myList
foo()
Control.py:
handleA = subprocess.Popen(["python", "Generator.py"])
My Objective is to avial myList in Control.py. In this case how can I do this ? I was planning to use multiprocessing.Queue but question is how to share Queue object with Generator.py through subprocess ?
What is best way to achieve this ?