I realize there are other threads addressing this problem but as I am fairly new to 'Classes' and have already constructed my class structure ... I would like to find a method that I can integrate into my code. I'm sure this will NOT be a difficult one to answer!
First File: NameResult.py
from NameAssign import *
NameList = NameWorks()
print(NameList.InputNames(NameVar))
Second File: NameAssign.py
class NameWorks:
def __init__(self, NameVar = []):
self.NameVar = NameVar
def InputNames(self, NameVar):
global NameVar
NameVar = ['harry', 'betty', 'sam']
Result:
NameError: name 'NameVar' is not defined
All replies are much appreciated ...