An enhanced and visually polished calculator built with Python's Tkinter library โ version 2 introduces a modern color scheme, improved input validation, and a live expression history display.
- Basic arithmetic operations:
+,-,ร,รท - Live expression preview (history-like feature)
- Error handling for invalid inputs (e.g.,
โ ๏ธ Error) - AC (All Clear) and CE (Clear Entry) buttons
- Prevents alphabetical input in the entry field
- Enhanced color scheme and cleaner UI layout
- Language: Python 3
- GUI Library: Tkinter (comes built-in with Python)
- Make sure Python is installed on your system.
- Clone this repository:
git clone https://github.com/KrishnaSingh-bit/Calculator-tkinter.git
- Navigate to the project folder and run:
cd tkinter-calculator
python main.py
- Verify if Tkinter is available:
python -m tkinter
๐ก Also, ensure
image.png(the icon) andscreenshot.pngare placed correctly in the same directory.
๐ tkinter-calculator/
โฃ ๐ main.py # Main app file (v2)
โฃ ๐ README.md # Project readme (this file)
โฃ ๐ท screenshot.png # UI image
โ ๐ผ image.png # Window icon for the app
- Managing Tkinter widgets and grid-based layouts
- Input validation using
validatecommand - Handling errors with
try/exceptinside a GUI context - Using
StringVar()and.trace()for real-time updates - Making cleaner, user-friendly UI designs
- Keyboard input bindings for faster input
- Add scientific operations (e.g., sin, cos, log)
- Responsive design or fullscreen toggle
- Theme toggle: light/dark modes
- Exporting expression history
This project is open-source under the MIT License.
Hi! I'm Krishna Singh, a student and aspiring Computer Science engineer.
This is version 2 of my calculator GUI project โ feel free to try it out or share feedback!
