Hi all,
to start with, excuse me, I'm still learning programming alltogether,
probably I'm making some fundamental mistake here...
I have the files settings.py, GUIclasses.py and main.py in the same
directory. In the file main.py are the statements:
import settings
from GUIclasses import *
class Toepassing(wx.A pp):
def OnInit(self):
window = KFrame(None, "Testerdete st", (1000,900))
self.SetTopWind ow(window)
window.Show(Tru e)
return True
app = Toepassing(None )
app.MainLoop()
In the file GUIclasses.py I have the statements:
import wx
import wx.lib.mixins.l istctrl as listmix
class KFrame(wx.Frame ):
def __init__(self, parent, title, Size):
...some code...
self.lst = settings.attrLi jst
....some more code......
Now if I run the main.py file I get the error:
File "G:\Programmere n\Codes contactenlijst\ GUIclasses.py", line 40,
in __init_
_
self.lst = settings.attrLi jst
NameError: name 'settings' is not defined
Why is this? Since "from GUIclasses import *" this KFrame is now at
"the lowest" namespace and should therefore be able to make use of any
variables living there, including "settings.* ", no?
Thanks in advance!
- Kees
to start with, excuse me, I'm still learning programming alltogether,
probably I'm making some fundamental mistake here...
I have the files settings.py, GUIclasses.py and main.py in the same
directory. In the file main.py are the statements:
import settings
from GUIclasses import *
class Toepassing(wx.A pp):
def OnInit(self):
window = KFrame(None, "Testerdete st", (1000,900))
self.SetTopWind ow(window)
window.Show(Tru e)
return True
app = Toepassing(None )
app.MainLoop()
In the file GUIclasses.py I have the statements:
import wx
import wx.lib.mixins.l istctrl as listmix
class KFrame(wx.Frame ):
def __init__(self, parent, title, Size):
...some code...
self.lst = settings.attrLi jst
....some more code......
Now if I run the main.py file I get the error:
File "G:\Programmere n\Codes contactenlijst\ GUIclasses.py", line 40,
in __init_
_
self.lst = settings.attrLi jst
NameError: name 'settings' is not defined
Why is this? Since "from GUIclasses import *" this KFrame is now at
"the lowest" namespace and should therefore be able to make use of any
variables living there, including "settings.* ", no?
Thanks in advance!
- Kees
Comment