This is a simple calculator program built using Python's Tkinter library. It's designed to parse and evaluate basic arithmetic expressions in a custom syntax.
- Supports addition (+), subtraction (-), multiplication (*), and division (/) operations.
- Handles integer and floating-point numbers.
- Parses expressions enclosed within parentheses.
- Provides error handling for illegal characters, incorrect expressions, and missing '|' at the end of expressions.
- Displays parsed tokens and the result of the calculation.
- Clone the repository to your local machine.
- Make sure you have Python installed.
- Run the
main.py
file using Python. - Enter the expression in the input field and click the "Calculate" button.
- View the result and parsed tokens in their respective fields.
1&2#3
: Evaluates to7
.10 ! (2 & 3)
: Evaluates to2.0
.5.5 # (4 % 2.5)
: Evaluates to11.0
.
&
: Addition operator.%
: Subtraction operator.#
: Multiplication operator.!
: Division operator.(
and)
: Enclose expressions to define precedence.
- Ensure that each expression ends with the '|' symbol to indicate the end of the input.
- Only one dot (.) is allowed in floating-point numbers.
- Spaces and tabs are ignored.