A modern calculator application built with Python and Tkinter, featuring a personalized welcome screen and customizable color themes.
- User-friendly graphical interface
- Personalized welcome screen
- Customizable calculator background color
- Basic arithmetic operations (+, -, *, /)
- Chaining calculations
- Error handling for incorrect calculations
- Centered windows for better user experience
- Python 3.x
- Tkinter (usually comes with Python installation)
calculator/
│
├── calculator.py # Main calculator implementation
├── main.py # Entry point of the application
├── icon.ico # Application icon
└── README.md # Documentation
- Clone the repository or download the source code
- Ensure Python 3.x is installed on your system
- Place an icon file named
icon.ico
in the project directory - Run the application using
main.py
-
Run the application:
python main.py
-
On the welcome screen:
- Enter your name
- Choose a custom background color (optional)
- Click "Login" to access the calculator
- Or click "Quit" to exit
-
Using the calculator:
- Click number buttons (0-9) to input values
- Use operation buttons (+, -, *, /, %) for calculations
- Press "=" to see the result
- Press "C" to clear the display
- Results can be used in subsequent calculations
- Personalized greeting with user's name
- Color picker for calculator customization
- Input validation for smooth user experience
- Large, clear display for calculations
- Intuitive button layout
- Error handling for invalid operations
- Continuous calculation support
- Responsive design
- Custom background color based on user selection
The project consists of two main classes:
- Handles initial user interaction
- Manages name input and color selection
- Provides smooth transition to calculator
- Implements core calculator functionality
- Manages calculation display and updates
- Handles user input and mathematical operations
- Provides error handling and input validation
The calculator includes robust error handling for:
- Division by zero
- Invalid mathematical expressions
- Syntax errors
- Empty calculations
Feel free to fork this project and submit pull requests for any improvements.
This project is open-source and available for personal and educational use.