Panel Not Displaying In Frame

It's been quite a few years since I wrote a wxPython application and much
has changed. I'm re-reading wxPIA, on-line docs, and everything else I can
find to get back to speed. Starting this new application I have a main frame
and panel for user login. No errors generated, but the panel does not
display. I'm sure it's a simple change from what worked before (with a frame
and notebook), but I don't see the problem. Please show me what I'm not
seeing.

   Code follows (for pw.py):

#!/usr/bin/env python

import wx

class LoginPanel(wx.Panel):

   def __init__(self, *args, **kwds):
     wx.Panel.__init__(self, *args, **kwds)

     # Allow only 3 login attempts before shutting down application
     loginCount = 0

     self.Panel = wx.Panel(self)

     outerBox = wx.BoxSizer(wx.VERTICAL) # main container
     unameBox = wx.BoxSizer(wx.HORIZONTAL) # username container
     passwdBox = wx.BoxSizer(wx.HORIZONTAL) # password container
     buttonBox = wx.BoxSizer(wx.HORIZONTAL) # OK and Cancel buttons

     unameLab = wx.StaticText(self.panel, wx.ID_ANY, 'Username: ')
     self.uname = wx.TextCtrl(self.panel, wx.ID_ANY, size=wx.Size(200, 25),
                              style=wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|
                              wx.RAISED_BORDER)
     passwdLab = wx.StaticText(self.panel, wx.ID_ANY, 'Password: ')
     self.passwd = wx.TextCtrl(self.panel, wx.ID_ANY, size=wx.Size(200, 25),
                               style=wx.TE_PASSWORD|wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|
                               wx.RAISED_BORDER)

     unameBox.Add(unameLab, 0, wx.LEFT|wx.TOP, 5)
     unameBox.Add(self.uname, 0, wx.ALL, 5)

     passwdBox.Add(passwdLab, 0, wx.LEFT|wx.TOP, 5)
     passwdBox.Add(self.passwd, 0, wx.LEFT|wx.TOP, 5)

     self.okLogin = wx.Button(self, wx.ID_OK, 'OK')
     self.Bind(wx.EVT_BUTTON, self.OnOkLogin, self.okLogin)

     self.cancelLogin = wx.Button(self, wx.ID_CANCEL, 'Cancel')
     self.Bind(wx.EVT_BUTTON, self.OnCancelLogin, self.cancelLogin)

     buttonBox.Add((200, 0), 0)
     buttonBox.Add(self.okLogin, 0, wx.ALL, 5)
     buttonBox.Add(self.cancelLogin, 0, wx.ALL, 5)

     outerBox.Add(unameBox, 0, wx.ALL, 5)
     outerBox.Add(passwdBox, 0, wx.ALL, 5)
     outerBox.Add(buttonBox, 0, wx.ALL, 5)

     panel.SetSizer(outerBox)
     panel.Layout()

   def OnOkLogin(self, event):
     loginCount += 1
     if loginCount > 3:
       self.Close()
     pass

   def OnCancelLogin(self, event):
     pass

   # End of class LoginPanel

class MainFrame(wx.Frame):

   def __init__(self, *args, **kwds):
     kwds["style"] = wx.DEFAULT_FRAME_STYLE|wx.FULL_REPAINT_ON_RESIZE|wx.TAB_TRAVERSAL
     wx.Frame.__init__(self, None, wx.ID_ANY, title='PermitWatch', size=(800,600))

   def OnFileClose(self, event):
     pass

   def OnQuit(self, event):
     self.Close()

   def OnHelpAbout(self, event):
     self.helpdlg(event)

# end of class MainFrame

if __name__ == "__main__":
   pw = wx.App(0)
   frame = MainFrame("PermitWatch")
   pw.SetTopWindow(frame)
   frame.Show()
   pw.MainLoop()

···

----------------------------------------------------------------------------------

Thanks,

Rich

Is the answer simply that you never actually call panel = LoginPanel() in
your frame?

Che

···

On Fri, Apr 18, 2014 at 2:53 PM, Rich Shepard <rshepard@appl-ecosys.com>wrote:

  It's been quite a few years since I wrote a wxPython application and much
has changed. I'm re-reading wxPIA, on-line docs, and everything else I can
find to get back to speed. Starting this new application I have a main
frame
and panel for user login. No errors generated, but the panel does not
display. I'm sure it's a simple change from what worked before (with a
frame
and notebook), but I don't see the problem. Please show me what I'm not
seeing.

(I should have put:

panel = LoginPanel(self)

so it was parented to the frame, and whatever other arguments you pass, but
you got the idea)

···

On Fri, Apr 18, 2014 at 3:05 PM, C M <cmpython@gmail.com> wrote:

On Fri, Apr 18, 2014 at 2:53 PM, Rich Shepard <rshepard@appl-ecosys.com>wrote:

  It's been quite a few years since I wrote a wxPython application and
much
has changed. I'm re-reading wxPIA, on-line docs, and everything else I can
find to get back to speed. Starting this new application I have a main
frame
and panel for user login. No errors generated, but the panel does not
display. I'm sure it's a simple change from what worked before (with a
frame
and notebook), but I don't see the problem. Please show me what I'm not
seeing.

Is the answer simply that you never actually call panel = LoginPanel() in
your frame?

Also, within the LoginPanel class you are creating another panel and assigning everything to it. I was able to get this to work:

#!/usr/bin/env python

import wx

class LoginPanel(wx.Panel):

def init(self, *args, **kwds):

wx.Panel.init(self, *args, **kwds)

Allow only 3 login attempts before shutting down application

loginCount = 0

outerBox = wx.BoxSizer(wx.VERTICAL) # main container

unameBox = wx.BoxSizer(wx.HORIZONTAL) # username container

passwdBox = wx.BoxSizer(wx.HORIZONTAL) # password container

buttonBox = wx.BoxSizer(wx.HORIZONTAL) # OK and Cancel buttons

unameLab = wx.StaticText(self, wx.ID_ANY, 'Username: ')

self.uname = wx.TextCtrl(self, wx.ID_ANY, size=wx.Size(200, 25),

style=wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|

wx.RAISED_BORDER)

passwdLab = wx.StaticText(self, wx.ID_ANY, 'Password: ')

self.passwd = wx.TextCtrl(self, wx.ID_ANY, size=wx.Size(200, 25),

style=wx.TE_PASSWORD|wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|

wx.RAISED_BORDER)

unameBox.Add(unameLab, 0, wx.LEFT|wx.TOP, 5)

unameBox.Add(self.uname, 0, wx.ALL, 5)

passwdBox.Add(passwdLab, 0, wx.LEFT|wx.TOP, 5)

passwdBox.Add(self.passwd, 0, wx.LEFT|wx.TOP, 5)

self.okLogin = wx.Button(self, wx.ID_OK, ‘OK’)

self.Bind(wx.EVT_BUTTON, self.OnOkLogin, self.okLogin)

self.cancelLogin = wx.Button(self, wx.ID_CANCEL, ‘Cancel’)

self.Bind(wx.EVT_BUTTON, self.OnCancelLogin, self.cancelLogin)

buttonBox.Add((200, 0), 0)

buttonBox.Add(self.okLogin, 0, wx.ALL, 5)

buttonBox.Add(self.cancelLogin, 0, wx.ALL, 5)

outerBox.Add(unameBox, 0, wx.ALL, 5)

outerBox.Add(passwdBox, 0, wx.ALL, 5)

outerBox.Add(buttonBox, 0, wx.ALL, 5)

self.SetSizer(outerBox)

def OnOkLogin(self, event):

loginCount += 1

if loginCount > 3:

self.Close()

pass

def OnCancelLogin(self, event):

pass

End of class LoginPanel

class MainFrame(wx.Frame):

def init(self, *args, **kwds):

kwds[“style”] = wx.DEFAULT_FRAME_STYLE|wx.FULL_REPAINT_ON_RESIZE|wx.TAB_TRAVERSAL

wx.Frame.init(self, None, wx.ID_ANY, title=‘PermitWatch’, size=(800,600))

self.panel = LoginPanel(self)

self.panel.Layout()

def OnFileClose(self, event):

pass

def OnQuit(self, event):

self.Close()

def OnHelpAbout(self, event):

self.helpdlg(event)

end of class MainFrame

if name == “main”:

pw = wx.App(0)

frame = MainFrame(“PermitWatch”)

pw.SetTopWindow(frame)

frame.Show()

pw.MainLoop()

I removed the ‘self.Panel = wx.Panel(self)’ and replaced all references to it within the LoginPanel class with ‘self’, then moved the ‘self.panel.Layout()’ to your MainFrame class.

···

On Friday, April 18, 2014 3:05:10 PM UTC-4, Che M wrote:

On Fri, Apr 18, 2014 at 2:53 PM, Rich Shepard rshe...@appl-ecosys.com wrote:

It’s been quite a few years since I wrote a wxPython application and much

has changed. I’m re-reading wxPIA, on-line docs, and everything else I can

find to get back to speed. Starting this new application I have a main frame

and panel for user login. No errors generated, but the panel does not

display. I’m sure it’s a simple change from what worked before (with a frame

and notebook), but I don’t see the problem. Please show me what I’m not

seeing.

Is the answer simply that you never actually call panel = LoginPanel() in your frame?

Che

I forgot to add in, I tested this with PortablePython 2.7.5, wxPython 2.9.5.0 (Classic).

···

On Friday, April 18, 2014 2:53:13 PM UTC-4, fuzzydoc wrote:

It’s been quite a few years since I wrote a wxPython application and much

has changed. I’m re-reading wxPIA, on-line docs, and everything else I can

find to get back to speed. Starting this new application I have a main frame

and panel for user login. No errors generated, but the panel does not

display. I’m sure it’s a simple change from what worked before (with a frame

and notebook), but I don’t see the problem. Please show me what I’m not

seeing.

Code follows (for pw.py):

#!/usr/bin/env python

import wx

class LoginPanel(wx.Panel):

def init(self, *args, **kwds):

 wx.Panel.__init__(self,  *args, **kwds)



 # Allow only 3 login attempts before shutting down application

 loginCount = 0



 self.Panel = wx.Panel(self)



 outerBox = wx.BoxSizer(wx.VERTICAL)    # main container

 unameBox = wx.BoxSizer(wx.HORIZONTAL)  # username container

 passwdBox = wx.BoxSizer(wx.HORIZONTAL) # password container

 buttonBox = wx.BoxSizer(wx.HORIZONTAL) # OK and Cancel buttons



 unameLab = wx.StaticText(self.panel, wx.ID_ANY, 'Username: ')

 self.uname = wx.TextCtrl(self.panel, wx.ID_ANY, size=wx.Size(200, 25),

                          style=wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|

                          wx.RAISED_BORDER)

 passwdLab = wx.StaticText(self.panel, wx.ID_ANY, 'Password: ')

 self.passwd = wx.TextCtrl(self.panel, wx.ID_ANY, size=wx.Size(200, 25),

                           style=wx.TE_PASSWORD|wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|

                           wx.RAISED_BORDER)



 unameBox.Add(unameLab, 0, wx.LEFT|wx.TOP, 5)

 unameBox.Add(self.uname, 0, wx.ALL, 5)



 passwdBox.Add(passwdLab, 0, wx.LEFT|wx.TOP, 5)

 passwdBox.Add(self.passwd, 0, wx.LEFT|wx.TOP, 5)



 self.okLogin = wx.Button(self, wx.ID_OK, 'OK')

 self.Bind(wx.EVT_BUTTON, self.OnOkLogin, self.okLogin)



 self.cancelLogin = wx.Button(self, wx.ID_CANCEL, 'Cancel')

 self.Bind(wx.EVT_BUTTON, self.OnCancelLogin, self.cancelLogin)



 buttonBox.Add((200, 0), 0)

 buttonBox.Add(self.okLogin, 0, wx.ALL, 5)

 buttonBox.Add(self.cancelLogin, 0, wx.ALL, 5)



 outerBox.Add(unameBox, 0, wx.ALL, 5)

 outerBox.Add(passwdBox, 0, wx.ALL, 5)

 outerBox.Add(buttonBox, 0, wx.ALL, 5)



 panel.SetSizer(outerBox)

 panel.Layout()

def OnOkLogin(self, event):

 loginCount += 1

 if loginCount > 3:

   self.Close()

 pass

def OnCancelLogin(self, event):

 pass

End of class LoginPanel

class MainFrame(wx.Frame):

def init(self, *args, **kwds):

 kwds["style"] = wx.DEFAULT_FRAME_STYLE|wx.FULL_REPAINT_ON_RESIZE|wx.TAB_TRAVERSAL

 wx.Frame.__init__(self, None, wx.ID_ANY, title='PermitWatch', size=(800,600))

def OnFileClose(self, event):

 pass

def OnQuit(self, event):

 self.Close()

def OnHelpAbout(self, event):

 self.helpdlg(event)

end of class MainFrame

if name == “main”:

pw = wx.App(0)

frame = MainFrame(“PermitWatch”)

pw.SetTopWindow(frame)

frame.Show()

pw.MainLoop()


Thanks,

Rich

Che,

   Probably. All the examples I've seen have the panel defined within the
frame's init defintion. I could not get any of those to work for me. Is the
call to LoginPanel() placed in the init() method?

Thanks,

Rich

···

On Fri, 18 Apr 2014, C M wrote:

Is the answer simply that you never actually call panel = LoginPanel() in
your frame?

Che,

   Yes, I do. Now I need to adjust the size and position but progress has
been made.

Thanks very much,

Rich

···

On Fri, 18 Apr 2014, C M wrote:

(I should have put:
panel = LoginPanel(self)
so it was parented to the frame, and whatever other arguments you pass, but
you got the idea)

Mike,

   This removes all errors, but only a fragment of the panel (the
wx.TextEntry) widget is visible in the top left corner. I need to put the
position information in the panel.__init__() ... I think.

Thanks,

Rich

···

On Fri, 18 Apr 2014, Mike Stover wrote:

Also, within the LoginPanel class you are creating another panel and
assigning everything to it. I was able to get this to work:

I removed the 'self.Panel = wx.Panel(self)' and replaced all references to
it within the LoginPanel class with 'self', then moved the
'self.panel.Layout()' to your MainFrame class.

Python-2.7.5, wxPython-3.0.0.0 on Slackware-14.1.

Rich

···

On Fri, 18 Apr 2014, Mike Stover wrote:

I forgot to add in, I tested this with PortablePython 2.7.5, wxPython
2.9.5.0 (Classic).

It doesn't matter where the call is made, as long as the interpreter
actually gets to that place and does call it. The frame's __init__ method
will always get called, so that is one place to put it. But, in a larger
application, if you are doing a lot of things within __init__ maybe it is
better to just call one or two functions that do various setups for your
widgets and subpanels, to keep __init__ not too cluttered. Something like
a self.SetupWidgets() method and then you'd have a def somewhere below
where all that is defined.

···

On Fri, Apr 18, 2014 at 4:15 PM, Rich Shepard <rshepard@appl-ecosys.com>wrote:

On Fri, 18 Apr 2014, C M wrote:

Is the answer simply that you never actually call panel = LoginPanel() in

your frame?

Che,

  Probably. All the examples I've seen have the panel defined within the
frame's init defintion. I could not get any of those to work for me. Is the
call to LoginPanel() placed in the init() method?

Che,

   Excellent advice, and essentially what I did in the older application
which uses a notebook as the main widget container within the main frame.

   I think my issues are related to changes since the 2.5.x version I used in
2004-2005 and the 3.0.0.0 version now installed. I'm looking for a changelog
that explains what's been added and dropped and explains the new features.

Carpe weekend,

Rich

···

On Fri, 18 Apr 2014, C M wrote:

It doesn't matter where the call is made, as long as the interpreter
actually gets to that place and does call it. The frame's __init__ method
will always get called, so that is one place to put it. But, in a larger
application, if you are doing a lot of things within __init__ maybe it is
better to just call one or two functions that do various setups for your
widgets and subpanels, to keep __init__ not too cluttered. Something like
a self.SetupWidgets() method and then you'd have a def somewhere below
where all that is defined.

Rich,

The one thing that you probably also need to be aware of is that wxPython has, mostly as a result of changes in wxWidgets, become less forgiving of some sloppy coding/assumptions. I have a large project that I am in the process of moving from Python 2.5.4/wxPython 2.6 to Python 2.7.7/wxPython 3.0 while maintaining the original code and when I find something that doesn't work in the newer implementation 90% of the time it tracks to an assert that once I have figured out how to avoid hitting that assert I find that either in the older environment works it unchanged or works better, i.e. I should have been doing it that way all along but was getting away with it in the older environment.

Gadget/Steve
(Enjoy the long weekend).

···

On 19/04/14 00:06, Rich Shepard wrote:

On Fri, 18 Apr 2014, C M wrote:

It doesn't matter where the call is made, as long as the interpreter
actually gets to that place and does call it. The frame's __init__ method
will always get called, so that is one place to put it. But, in a larger
application, if you are doing a lot of things within __init__ maybe it is
better to just call one or two functions that do various setups for your
widgets and subpanels, to keep __init__ not too cluttered. Something like
a self.SetupWidgets() method and then you'd have a def somewhere below
where all that is defined.

Che,

  Excellent advice, and essentially what I did in the older application
which uses a notebook as the main widget container within the main frame.

  I think my issues are related to changes since the 2.5.x version I used in
2004-2005 and the 3.0.0.0 version now installed. I'm looking for a changelog
that explains what's been added and dropped and explains the new features.

Carpe weekend,

Rich

Hi Rich,

...

  I think my issues are related to changes since the 2.5.x version I used in
2004-2005 and the 3.0.0.0 version now installed. I'm looking for a changelog
that explains what's been added and dropped and explains the new features.

Normally you have a changes document in your wx installation folder within the docs folder.

The Phoenix doc not on the wxPython home page is due to it still being work in progress.

However Phoenix is getting there and you might want to give it a try.

Werner

···

On 4/19/2014 1:06, Rich Shepard wrote:

The one thing that you probably also need to be aware of is that wxPython
has, mostly as a result of changes in wxWidgets, become less forgiving of
some sloppy coding/assumptions. I have a large project that I am in the
process of moving from Python 2.5.4/wxPython 2.6 to Python 2.7.7/wxPython
3.0 while maintaining the original code and when I find something that
doesn't work in the newer implementation 90% of the time it tracks to an
assert that once I have figured out how to avoid hitting that assert I
find that either in the older environment works it unchanged or works
better, i.e. I should have been doing it that way all along but was
getting away with it in the older environment.

Steve,

   I have assumed that much has changed in the intervening years. The only
references books I have are pre-changes. When I see examples on web sites
and blogs they use structures such as the super() method in init() methods,
but I find no explanation what they do, when they're appropriate, and how to
use them to achieve a desired goal. It's too bad that wxPIA has not been
updated with second or third editions.

   You are certainly correct that coding practices with wxPython have
changed. I'm looking for documentation on those changes and current best
practices so I can move this project ahead.

(Enjoy the long weekend).

   Thanks. It's just a normal weekend of yard work and cleaning vehicles and
the house for me. :slight_smile:

Rich

···

On Sat, 19 Apr 2014, Steve Barnes wrote:

Werner,

   Good point. I build and install from the SlackBuilds script. Normally I
don't untar the source tarball, but I did so I can get to the docs
subdirectory. I'll read the changes files.

···

On Sat, 19 Apr 2014, Werner wrote:

Normally you have a changes document in your wx installation folder within the docs folder.

=

The Phoenix doc not on the wxPython home page is due to it still being work in progress.

   Makes sense.

However Phoenix is getting there and you might want to give it a try.

   I'll figure out what it is and go about learning it.

Thanks,

Rich

Hi Rich and all,

"When I see examples on web sites and blogs they use structures such as the super() method in init() methods, but I find no explanation what they do, when they’re appropriate, and how to

use them to achieve a desired goal."

Indeed.

I had high hopes for learning best practices and how to write maintainable and extendable wxPython code from Cody’s book - http://www.amazon.com/wxPython-2-8-Application-Development-Cookbook/dp/1849511780/ - but it jumps right in with super() without giving much background on why one would do that. The learning curve is too steep for me.

It looks like I need to read more of Mike’s blog - http://www.blog.pythonlibrary.org/2014/01/21/python-201-what-is-super/

His book looks promising, too - http://www.blog.pythonlibrary.org/buy-the-book/

:wink:

To be clear, I’m not blaming anyone for the background that I don’t have. Every wxPython book and code project that is publicly available adds to the library of useful information. It’s just, for me, there seems to be a huge jump between the (often not fully functional) “hello world” examples at places like ZetCode and giant things like Phatch and Chandler… I’m not sure how this problem can be addressed for those of us in this boat.

There’s a lot of information out there, but it can be hard to find. Mike’s blog is a great resource. I really need to study MediaLocker more carefully - http://www.blog.pythonlibrary.org/2011/12/09/ann-medialocker-%E2%80%93-a-wxpython-app-to-track-your-media/

:slight_smile:

FWIW.

Cheers,

Scott.

···

On Sat, Apr 19, 2014 at 9:08 AM, Rich Shepard rshepard@appl-ecosys.com wrote:

On Sat, 19 Apr 2014, Steve Barnes wrote:

The one thing that you probably also need to be aware of is that wxPython

has, mostly as a result of changes in wxWidgets, become less forgiving of

some sloppy coding/assumptions. I have a large project that I am in the

process of moving from Python 2.5.4/wxPython 2.6 to Python 2.7.7/wxPython

3.0 while maintaining the original code and when I find something that

doesn’t work in the newer implementation 90% of the time it tracks to an

assert that once I have figured out how to avoid hitting that assert I

find that either in the older environment works it unchanged or works

better, i.e. I should have been doing it that way all along but was

getting away with it in the older environment.

Steve,

I have assumed that much has changed in the intervening years. The only

references books I have are pre-changes. When I see examples on web sites

and blogs they use structures such as the super() method in init() methods,

but I find no explanation what they do, when they’re appropriate, and how to

use them to achieve a desired goal. It’s too bad that wxPIA has not been

updated with second or third editions.

You are certainly correct that coding practices with wxPython have

changed. I’m looking for documentation on those changes and current best

practices so I can move this project ahead.

(Enjoy the long weekend).

Thanks. It’s just a normal weekend of yard work and cleaning vehicles and

the house for me. :slight_smile:

Rich

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Rich,

...

However Phoenix is getting there and you might want to give it a try.

  I'll figure out what it is and go about learning it.

A bit of reading if you get tired of yard work etc:-) .

http://wiki.wxpython.org/ProjectPhoenix
http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html
http://wxpython.org/Phoenix/docs/html/MigrationGuide.html

As of a few days ago the builds for Phoenix are generating wheels, so to install it you just need:

1. If you are not on Python 3.4 you need to download pip
2. pip install -U --pre -f Index of /Phoenix/snapshot-builds wxPython_Phoenix

The '-U' switch is to upgrade your install but it doesn't matter if you use it on first install either. Above will then create a 'wx' folder in your site-packages folder.

If you want to keep your code compatible with classic you can do:

if 'phoenix' in wx.PlatformInfo:
     pyControl = wx.Control
else:
     pyControl = wx.PyControl

If you want to keep your code compatible with Py2 and Py3 then you can use the 'six' module, it is included in Phoenix as 'wx.lib.six'.

Have a nice weekend
Werner

···

On 4/19/2014 15:17, Rich Shepard wrote:

Thanks to everyone who's responded. I've learned that I need to step back
and learn first what's changed in Python over the past few years. Then I'll
research changes in wxPython before resuming work on this project. In the
end it will save time and effort.

   My readings in the past suggest holding off on learning/moving to Python3.
Any informed opinions here on this? I believe that SQLAlchemy is still
rooted in Python2 but I'm not committed to that tool so I don't have a sound
basis for deciding which Python version to focus on for this project.

Rich

···

On Fri, 18 Apr 2014, Rich Shepard wrote:

It's been quite a few years since I wrote a wxPython application and much
has changed. I'm re-reading wxPIA, on-line docs, and everything else I can
find to get back to speed. Starting this new application I have a main
frame and panel for user login. No errors generated, but the panel does
not display. I'm sure it's a simple change from what worked before (with a
frame and notebook), but I don't see the problem. Please show me what I'm
not seeing.

Rich Shepard wrote:

I have assumed that much has changed in the intervening years. The only
references books I have are pre-changes. When I see examples on web sites
and blogs they use structures such as the super() method in init() methods,
but I find no explanation what they do, when they're appropriate, and
how to
use them to achieve a desired goal.

https://docs.python.org/2/library/functions.html#super

super() is a built-in Python function that helps with calling methods in base classes or sibling classes (siblings in a multiple inheritance situation). The use of super is not necessary in wxPython-derived classes, but it is handy and is a good habit to get into so it is more familiar to you if/when you do need to use super in the future.

···

--
Robin Dunn
Software Craftsman

A useful article on super here Python’s super() considered super! | Deep Thoughts by Raymond Hettinger

···

On 19/04/2014 20:46, Robin Dunn wrote:

Rich Shepard wrote:

I have assumed that much has changed in the intervening years. The only
references books I have are pre-changes. When I see examples on web sites
and blogs they use structures such as the super() method in init()
methods,
but I find no explanation what they do, when they're appropriate, and
how to
use them to achieve a desired goal.

2. Built-in Functions — Python 2.7.18 documentation

super() is a built-in Python function that helps with calling methods in
base classes or sibling classes (siblings in a multiple inheritance
situation). The use of super is not necessary in wxPython-derived
classes, but it is handy and is a good habit to get into so it is more
familiar to you if/when you do need to use super in the future.

--
My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language.

Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection is active.