How 0southboss0/expression-calculator works
This is a Tkinter expression calculator. A user enters an expression and activates calculation; the view dispatches to the presenter, which asks the model to tokenize the input, convert tokens to postfix notation, and evaluate the result, then displays the value or an error. The README documents arithmetic, trigonometric, and other mathematical functions. The model excerpt is partial, so internal tokenizer and evaluator details are represented at the documented stage level.
Main entry points: presenter.py Calculation presenter · view.py Tkinter calculator view · model.py Postfix evaluator · main.py Application entry
Components 9
User interface
- Tkinter calculator view
view.py
Application flow
- Application entry
main.py - Calculation presenter
presenter.py
Expression calculation
- Expression tokenizer
model.py - Shunting-yard conversion
model.py - Postfix evaluator
model.py
Other components
- Calculator user
- Python math
- NumPy functions
Connections 13
- Application entry → Tkinter calculator view: creates and initializes
- Application entry → Calculation presenter: wires
- Calculator user → Tkinter calculator view: enters expression
- Tkinter calculator view → Calculation presenter: dispatches calculation
- Calculation presenter → Tkinter calculator view: reads input
- Calculation presenter → Expression tokenizer: tokenizes input
- Expression tokenizer → Calculation presenter: returns tokens
- Calculation presenter → Shunting-yard conversion: converts tokens
- Shunting-yard conversion → Calculation presenter: returns postfix
- Calculation presenter → Postfix evaluator: evaluates postfix
- Postfix evaluator → Python math: calls functions
- Postfix evaluator → NumPy functions: calls trig functions
- Calculation presenter → Tkinter calculator view: displays result or error