This project was developed on M1 (Arm64 based) based Mac, using Microsoft's Visual Studio Code Version: 1.72.0. The intention is to be compatible with any system through Python's multiplatform nature. However, this project will only be tested on Windows 10 amd64 machine and the latest MacOS version on an Arm64 machine.
This program contains the following directories of interest under src:
./src/
- contains the source code for the program
1. Definitions
2. Prerequisites
3. Initializing the Virtual Environment
4. Running The Program From a Shell
5. Running The Program
6. Testing The Code base
7. UML
"./" or "this directory"
- meaning the top level directory of this project, which happens to be the directory that this README.md file has been saved. The README.md is at the top level of this Python project, the project is in a folder named "James_Mortensen_Assignment_1""VSCODE"
- Visual Studio Code
The *.sh scripts in this repository should be runnable on MacOS and Windows, as tested via the following shell programs.
These shell programs have been integrated with VSCODE using its Integrated Terminal features:
- Windows: MinGW
- MacOS: Zsh
Set one of these programs as the integrated terminal in VSCODE
NOTE: It is not in the socpe of this document to show how to connect these terminals with VSCODE, since this is straightforward and documented online with plenty of support.
- Visual Studio Code + Extenstions: "Pylance v2022.10.30" and "Python v2022.16.1"
- Python 3.11.2: https://www.python.org/downloads/release/python-373/
In Visual Studio Code, using a system level install of Python 3.11.2.
-
Give executable rights to the script "./init-venv.sh".
-
In MinGW or Zsh run:
./init-venv.sh
-
A directory titled "./venv" should now be created.
-
At this time the python extension in VSCODE should show an available interpreter called "venv" located at ./venv.
-
"./.vscode/settings.json" includes a setting that should automatically activate the selected virtual environment when a new integrated terminal is created (use Ctrl + ` to invoke a new terminal).
a) if VSCODE does not automatically activate the virtual environment, then it may be necessary to run the following command manually:
source ./venv/bin/activate
"(venv)" should now show at the beginning of each terminal line.
Bundled with the source code, as stated before, is the ./.vscode folder. This folder contains a "launch.json" file. This file is used to configure the Python extension to debug the program from the program entry point ./run.py.
./run.py is used to tell the interpreter that the top level of the project is the folder ".".
run.py can be invoked one of two ways, either through VSCODE's integrated debug features, or via the virtual environment's interpreter via the shell.
- Follow the procedure to initialize and activate the virtual environment.
- Run the following command:
python run.py
- Change to the debugging sidebar view.
- Next to the green arrow at the top of the sidebar, ensure "run.py" is selected as the current configuration.
- Place a breakpoint in the program
- Click the green arrow
- Program should be running in debug mode at this time.
Future projects may provide a "frozen" version of the program, providing an executable package to the end user, which will bundle the interpreter with the executable as one set.
This is a placeholder for the procedure.
Follow the above procedures for initializing the virtual environment, then run:
./test.sh
The UML Diagrams for this program have been provided in the folder ./docs/UML
.
The model was developed using StarUML Educational License. 2 output images were produced in .png and .jpg formats.
Models.mdj is the raw file that can be edited using StarUML.