I've recreated this error in a simpler file.
main.py
from funcA import *
test()
print(x)
funcA.py
def test():
global x
y = 2
return x
I receive "NameError: name 'x' is not defined", what am I missing?
from funcA import * creates a new variable named x in the global scope of main.py. Its initial value comes from funcA.x, but it is a distinct variable that isn't linked to funcA.x.
When you call test, you update the value of funcA.x, but main.x remains unchanged.
After you call test, you can see the change by looking at funcA.x directly.
from funcA import *
import funcA
test()
print(funcA.x)
xanywhere... I guess you.meanyx = 2? In any case, that would not createxin main.py