This calculator was built with Python 3.12 and Flask 3.0.3.
The logic for this program uses several regular expressions to read the user input and tokenize each part of the expression.
functions.py contains the code for all the tokenization and operator logic.
templates contains numberpad.html which generates a numberpad for user input.
HTML styling comes from styles.css.
For convenience, create and activate a python virtual environment
and then install the required version of flask by running:
-
for Windows
pip install -r requirements.txt
-
for Ubuntu
pip install -r UBUrequirements.txt
Next open up a terminal and navigate to the directory with app.py
Flask shares the same command for both systems
-
Run the app with:
python -m flask --app app.py run
-
Open a browser and navigate to
http://127.0.0.1:5000
-
1.1 (2025-01-07)
- Added support for longer expressions
- Deployed to vercel
- No error messages yet
-
1.0 (2024-09-11)
-
Accepts only single expression inputs in the form of:
Number operator Number
-