Python imports across modules and global variables
问题 I have a question which seems to be rather fundamental but I can't seem to find any help on this anywhere. file_a.py >> from xyz import XYZ class A: . . . file_b.py >> import file_a from file_a import A class B(A): def __init__(self): A.__init__(self) def someMethod(self): XYZ.doSomething() XYZ.doSomething() fails saying NameError: name 'XYZ' is not defined Even standard imports like 'import sys' done from file_a does not seem to render it usable in file_b. I assumed that should work. Is my