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 - Python Tutorial
From the course: Rapid Application Development with Python
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introducing wxPython2m 13s
-
(Locked)
Class-based skeleton4m 37s
-
(Locked)
Labels and buttons3m 38s
-
(Locked)
More on buttons3m 33s
-
(Locked)
Checkboxes and radio buttons6m 43s
-
(Locked)
Text entry controls4m 36s
-
(Locked)
Use spinners to set values4m 58s
-
(Locked)
Create lists to select from6m 9s
-
(Locked)
Use combo boxes54s
-
(Locked)
Compose a menu bar6m 46s
-
(Locked)
Challenge36s
-
(Locked)
Solution2m 54s
-
-
-
-