Confused about namespaces

KvS keesvanschaik at
Sat Nov 19 00:04:23 CET 2005

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, and in the same
directory. In the file are the statements:

import settings
from GUIclasses import *

class Toepassing(wx.App):
	def OnInit(self):
		window = KFrame(None, "Testerdetest", (1000,900))
		return True

app = Toepassing(None)

In the file I have the statements:

import wx
import wx.lib.mixins.listctrl  as  listmix

class KFrame(wx.Frame):
	def __init__(self, parent, title, Size):
                ...some code...
                self.lst = settings.attrLijst
                ....some more code......

Now if I run the file I get the error:

  File "G:\Programmeren\Codes contactenlijst\", line 40,
in __init_
    self.lst = settings.attrLijst
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

More information about the Python-list mailing list