A simple python GUI calculator using TKInter

Hello everybody, Welcome back to programminginpython.com! Now am going to show you how to make a simple python GUI application, basically, the app is a simple calculator which adds two numbers. I used TKInter which is a standard GUI package for python. In the previous post I covered about the basic introduction to GUI programming in python, here I will use those and also extend some other things to build this simple app.

You can also watch the video on YouTube here

Program on Github

Below are the screenshots, how our basic app looks like,

Calculator GUI - programminginpython.com
Calculator GUI – programminginpython.com
Calculator GUI - programminginpython.com
Calculator GUI – programminginpython.com


Here I used, grid layout for designing the layout, in the previous post, I told about pack() which sets the widgets automatically based on available space in the window, but here we can set the widgets where we want to place.

Firstly import and initialize TKInter,

I also set the size of the app and its title,

I also added some labels and input fields to read the entered numbers,

Then I add a button, when clicked, calculates the result and displays it in the label labelResult I initialized above.

Program on Github

So when the button is clicked, a function is called which calculates the sum of both the numbers.

The command parameter to Button function calls the call_resultfunction, which does the simple logic.

The call_result function.

Program on Github

Feel free to look at my previous posts on python GUI programming.


That’s it for this post guys, also feel free to look at other python tutorials on GUI Programming.


  1. Pingback: educational websites for students

  2. Pingback: school education

  3. Pingback: online education programs

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.