Welcome to the Simple Calculator application! This intuitive calculator is built using Python's Tkinter library and offers essential arithmetic operations with a user-friendly interface.
- Basic Arithmetic Operations: Effortlessly perform addition, subtraction, multiplication, and division.
- Clear Functionality: Quickly reset the display to zero with a single click.
- Dynamic Display: Watch the display update in real-time as you input numbers and operations.
- Error Handling: Receive clear "Error!" messages for any invalid operations or inputs.
- Python 3.x: Ensure you have Python installed on your system.
- Tkinter: This library is typically included with Python installations.
-
Clone the Repository: Download the source code to your local machine.
-
Verify Python Installation: Make sure Python is installed by running
python --version
in your terminal. -
Run the Application: Execute the following command in your terminal:
python calc.py
- Input Numbers: Click on the number buttons to enter numbers.
- Perform Operations: Use the operator buttons (
+
,-
,*
,/
) to execute calculations. - Calculate Result: Press the
=
button to evaluate the expression. - Clear Display: Hit the
C
button to reset the display to zero.
update_value(value)
: Updates the display with the selected button's value.clear_value()
: Resets the display to "0".calculate_result()
: Computes the expression on the display and shows the result. Displays "Error!" if the evaluation fails.
This application uses Python's eval()
function to evaluate expressions. While convenient, eval()
can execute arbitrary code, posing a security risk if the input is not controlled. For production environments, consider using a safer alternative for evaluating mathematical expressions.
We welcome contributions to enhance the Simple Calculator application! If you have ideas for improvements or new features, feel free to contribute. Here's how you can help:
-
Fork the Repository: Start by forking the repository to your GitHub account.
-
Clone the Repository: Clone your forked repository to your local machine.
git clone https://github.com/Goyam02/Simple-Calculator.git
-
Create a Branch: Create a new branch for your feature or bug fix.
git checkout -b feature-name
-
Make Changes: Implement your changes or new features.
-
Commit Changes: Commit your changes with a descriptive commit message.
git commit -m "Add feature: description of feature"
-
Push Changes: Push your changes to your forked repository.
git push origin feature-name
-
Create a Pull Request: Open a pull request to the main repository with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
- Developed with ❤️ using Python and Tkinter.
- Inspired by classic calculator applications.
- GOYAM JAIN