My python script have weird behavior. So, I have python script A, which calls another script B many times. For calling B, I'm using subprocess module.
Snippets of script A:
for i in range(0,10000):
parameters = []
parameters.append("B")
result = subprocess.call(parameters)
Snippets of script B:
testdata = some_logic
if testdata:
function_1()
else:
function_2()
So, script A will calls script B many times. After some tests, I noticed that variable testdata doesn't have expected value for current running script B. Is it somehow possible in running script B, that variable testdata has value from previous call B? What is scope for variable testdata in this case? Thanks for advice. Cheers
mutliprocessingis a completely different module where (with a little effort), you can share state between processes.