I have two python script test1 and test2. If I hit ctrl+B in sublime under test1.py, the expected output should be
7770 and 8880
test1.py
import subprocess
import test2
subprocess.call(["python", "test2.py","777"]) #subprocess.call compulsory
print(test2.b) #8880 from test2
test2.py
import sys
a = sys.argv[1]
a = a * 10
print(a) #7770
'''
after some calculation
'''
#now return some number back to test1.py
b = 8880
How would I selectively get b only back to test1?
Tried from test2 import b, it did not work. It attempt to bring in a too, that caused the problem.
Log:
Traceback (most recent call last):
File ".....\test1.py", line 2, in <module>
import test2
File "......\test2.py", line 3, in <module>
a = sys.argv[1]
IndexError: list index out of range