Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 2.15 KB

README.md

File metadata and controls

73 lines (45 loc) · 2.15 KB

Simple Calculator using Python Tkinter

This directory contains the source code for a simple graphical calculator application written in Python using the Tkinter library.

Description

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.

Screenshots

image

image

  • calc v2 (Using CustomTkinter)

Requirements

  • Python 3.x

  • Tkinter library (included in most standard Python installations)

  • CustomTkinter library (v2)


How to Run

  1. Save the code as a Python file (e.g., calculator.py).
  2. Open a terminal window and navigate to the directory where you saved the file.
  3. Run the following command in the terminal:

python calculator.py

This will launch the calculator application.


Acknowledgments

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.


License


This project is licensed under the MIT License.