Geometry Calculator Web
The web version of the Geometry Calculator Tool used in SENG3120 & SENG3110
Use this as sample code for related activities.
App Prep & Run Steps
To use this code do the following:
Pick a location on disk and clone this code into a local repository:
(Alternatively the new GitHub CLI could also be used)
A new directory will be created: geometry_calculator_web “cd” into it.
Create a Python Virtual Environment
This is a simple Flask-based Python Web App. It is advisable to use a Python Virtual Environment to keep this app’s dependencies separate from other Python dependencies on the target machine. To create a Virtual Environment do the following from within the geometry_calculator_web directory:
python3 -m venv venv
python -m venv venv
Activate the Virtual Environment:
Install App Dependencies Using the Python Package Tool:
Rather than using pip to install the required packages, such as Flask, etc., all dependencies are in the requirements.txt file.
pip install -r requirements.txt
In a virtual environment that was create using Python 3, on Unix OS’s there no need to use pip3. You can, but pip also works in this instance.
Run the Application:
The App should now be running. Access it via
Python Unit Testing
This repo also contains two sample Unit Tests. One for the cylinder.py module. One for the GeometryCalcWeb.py program. It is up to the student to understand how the Unit Tests work. Reference course resources, notes taken in class, instructor demo’s.
Run them by doing the following:
Geometry Calculator Web App