wxpython: can't even create a Panel

Tim Chase python.list at tim.thechases.com
Thu Jun 8 15:44:38 EDT 2006


>      def __init__(self, parent, title):
>          wx.Frame.__init__(self, parent, -1, title)
> 
>      panel = wx.Panel(self)


It looks like a subtle difference between

	panel = wx.Panel(self)

and

		panel = wx.Panel(self)

As the error message states, there is no "self" at the 
class-definition level...only within the method (__init__ in this 
case).

In the example code from which you're working, note the 
indentation level of the "panel = ..." line relative to the "def 
__init__" line, and compare with your code.

Subtle, but important. :)

-tkc






More information about the Python-list mailing list