I have to Python scripts. In the first script I import the second script and need to pass a value to the second script.
I tried the following:
test1.py:
import test2
test2.set_value(5)
test2.print_value()
test2.py:
value = None
def set_value(v):
print("Set value: " + str(v))
value = v
def print_value():
print(value)
But the output is:
Set value: 5
None
I'm using Python 3.5