I am trying to move variables between scripts. I have two scripts: script1.py and script2.py
In script1.py I am using sys.argv to create a variable called country. This variable is imported to script2.py which process the country variable. The problem is when I try to import this new variable back to script1.py I get the following error:
from script2 import rule
ImportError: cannot import name 'rule'
I am running the script1.py in the terminal
python script1.py us
script1.py
import sys
country = str(sys.argv[1])
from script2 import rule
print (rule)
script2.py
from script1 import country
rule = 'this is a rule' + country
Thanks!