A simple and stylish calculator built using Python's Tkinter library. This calculator supports basic arithmetic operations like addition, subtraction, multiplication, and division, along with features such as percentage calculation and square root. The user interface is enhanced with smooth hover effects and number formatting with commas and decimals.
- Basic arithmetic operations: +, -, *, /
- Percentage calculation (%)
- Square root calculation (√)
- Number formatting (commas for thousands, decimal support)
- Hover effects for buttons
- Clean and minimal UI with dynamic button styling
- Python 3.x
- Tkinter (comes pre-installed with Python)
- locale for number formatting
- Clone this repository:
git clone https://github.com/your-username/fancy-calculator.git
cd fancy-calculator
- Ensure you have Python 3.x installed on your system.
- If Tkinter is not installed, you can install it (though it is generally included with Python by default):
-
On Windows: Tkinter comes bundled with Python, so no need for installation.
-
On macOS/Linux:
sudo apt-get install python3-tk
-
- Run the script using Python:
python calculator.py
- Use the on-screen buttons to perform arithmetic operations.
- Enter numbers and press +, -, *, or / for operations.
- Press = to get the result.
- Use C to clear the input field.
- You can calculate percentages and square roots with the % and √ buttons.
- Numbers are formatted with commas for thousands and can handle decimal points.
- calculator.py: Main application file with logic and UI built using Tkinter.
- README.md: This file.
- Fork this repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m 'Add new feature'
- Push to the branch:
git push origin feature-name
- Create a pull request.
- Tkinter: The Python interface for the Tk GUI toolkit.
- Python's locale module: Used for formatting numbers with commas.