I really must have a general misunderstanding of import and global. I'm trying to call a function in an imported file and reference a variable.
from file2 import *
x = 6
file2Funct()
def file2Function():
print x
executing file1 give the following error at the "print x" line in file2.py:
NameError: global name 'x' is not defined
If I change file2.py as follows,
def file2Function():
global x
print x
produces the same error, same point.
What am I missing here? Thanks.