From the course: Rapid Application Development with Python
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution - Python Tutorial
From the course: Rapid Application Development with Python
Solution
(bright music) - [Instructor] Let's take a look at one way to solve the calculator challenge. Lines one to five remain the same as in our test program. At line six, I create a radio box with a choice for each operator and starting at line eight, I place the three entry fields plus the static text up and equals below the radio buttons. Note at line 15, I've made the result a read only text entry box so that it has the same look as the other two values. At line 16, I've created a button with the text compute and placed it below the entry fields. At line 17, I bind it to an event handler called on compute. At line 18, I create the list box for the calculations trail to the right of the pane with no initial data, and that's the design complete. Let's take a look at the on compute event handler. The calculation occurs when the compute button is pressed. At line 21, I start the calculation by extracting a floating point…
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
-
-
-
-