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

Solution - Python Tutorial

From the course: Rapid Application Development with Python

Start my 1-month free trial

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…

Contents