From the course: Rapid Application Development with Python

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Class-based skeleton

Class-based skeleton - Python Tutorial

From the course: Rapid Application Development with Python

Start my 1-month free trial

Class-based skeleton

- [Narrator] The hello world app is simpler than the normal structure of a wxPython program, so let's create the more commonly used wxPython skeleton program using class constructs to see what it looks like. This time we'll add slightly more complex code than we did before by defining the frame as a class with an initialization function and adding a panel to the frame. I'll call this wxTest.py. We'll start by importing the wxPython library. And I'll define the application frame class with just an initialization rooting. Class myFrame, which is a wx frame. And we'll define __init__, which refers to itself, with arguments and keywords. Which when invoked initializes a frame. Wx frame dot __init__, again with self, args and keywords. And set up a panel onto which our widgets will be placed with self.panel equals wx.panel. Self, and again using our ID_ANY object identifier. I'll now define our application class with an…

Contents