I have a parent python script which makes a subprocess call to another python script using Popen 10 times with diff arguments. I want this second script to make changes to a list declared in parent python script.
Right now I am doing:
p = [Popen("python child.py "+str(i),shell=True) for i in range(10)]
for i in p:
i.wait()
While this solves my purpose, now if I have a list declared before the Popen line and I want to access this list in child.py
, how do I do it?
I considered using pickle library but opening and closing a file for 10 times(as child.py is called 10 times) will just increase my I/O time which is not desirable.