This directory contains the source code for a simple graphical calculator application written in Python using the Tkinter library.
This Python code creates a basic calculator application with a graphical user interface (GUI). The GUI is built using the Tkinter library, which is included in the standard Python distribution.
The calculator can perform the following arithmetic operations:
-
Addition (+)
-
Subtraction (-)
-
Multiplication (*)
-
Division (/)
-
Exponentiation (x², implemented by entering "x²")
-
Modulo (%)
-
The calculator also includes buttons for:
-
Clear entry (CE) - clears the current expression in the input field
-
Clear all (C) - clears the entire input field
-
Backspace (⌫) - deletes the last character from the input field
-
Changing sign (+/-) - Inverts the sign of the current number in the input field
The calculator has a designated input field where the user can enter the expression they want to evaluate. Once the expression is entered, the user can click the equals (=) button to evaluate the expression and see the result displayed in the input field.
- calc v2 (Using CustomTkinter)
-
Python 3.x
-
Tkinter library (included in most standard Python installations)
-
CustomTkinter library (v2)
- Save the code as a Python file (e.g., calculator.py).
- Open a terminal window and navigate to the directory where you saved the file.
- Run the following command in the terminal:
python calculator.py
This will launch the calculator application.
This code utilizes the Tkinter library, a Python library for developing graphical user interfaces. CustomTkinter provides enhanced features and a modern look, building on the capabilities of the standard Tkinter library.
This project is licensed under the MIT License.