I am pretty new to programming with python. So apologies in advance: I have two python scripts which should share variables. Furthermore the first script (first.py) should call second script (second.py)
first.py:
import commands
x=5
print x
cmd = "path-to-second/second.py"
ou = commands.getoutput(cmd)
print x
second.py looks like this
print x
x=10
print x
I would expect the output: 5 5 10 10
In principle I need a way to communicate between the two scripts. Any solution which does this job is perfectly fine.
Thank you for your help!
Tim