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
Try use exec Python3.5:
first.py
x=5 exec(open('second.py').read())
second.py
print(x)
You can also pass x by using:
x=5 myVars = {'x':x} exec(open('second.py').read(), myVars)
Not sure if this is a good way.