Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Welcome to Code Forum!
Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.
Tkinter Calculator
In this tutorial we will build a simple calculator using tkinter and python.
Modules needed
tkinter
tkinter is installed by default with python
if it does not come with your version of python, it can be installed by
Ubuntu - sudo apt install python3-tk
MacOS - brew install...
In this tutorial we will get our tkinter window running and define our 2 classes
import tkinter as tk
from decimal import Decimal
class Window:
def __init__(self, parent):
self.parent = parent
''' We will be using the grid manager '''
parent.columnconfigure(0...
In part 2 of our project, we will be building the window graphics for the calculator.
We will:
Create a container to hold all the widgets
Create a entry field that will display the numbers, symbols, and results of calculations
Create a list of numbers and symbols used
Create an empty list to...
Simple Tkinter Calculator Part 3
In part3 we will:
Create methods in our Controller class
Bind the buttons to the methods
Create a simple validation
Create methods
def valid_input(self,arg):
''' Method for validating input '''
if arg.isalpha() or arg == '='...
Here is the full working code
# Do the imports
import tkinter as tk
from decimal import Decimal
class Window:
def __init__(self, parent):
self.parent = parent
''' We will be using the grid manager '''
parent.columnconfigure(0, weight=1)
parent.rowconfigure(0...