This repository provides a minimal starting point for using bocpy with Python.
- Python 3.10+ installed
pipavailable in your Python installation
From the project root:
python3 -m venv .venvIf python3 is not available on your machine, try:
python -m venv .venvmacOS / Linux:
source .venv/bin/activateWindows (PowerShell):
.venv\Scripts\Activate.ps1Windows (Command Prompt):
.venv\Scripts\activate.batYou should now see your shell prompt prefixed with (.venv).
Install bocpy from requirements.txt:
pip install -r requirements.txtBocPy comes with several examples. We can run the fibonacci example to verify the installation:
bocpy-fibonacciNow you can simply run any Python file using python <file>. hello.py has a minimal
"hello " example you can run with this:
python hello.py
You can find the cooking with BoC example from the lecture
in cooking.py. You can try adding a plating
step or maybe another ingredient.
passwords.py contains a simple brute-force
hash cracking script. It currently uses one core, try making
it concurrent using BocPy. You only need to modify the crack
function for this.
The implementation doesn't need to terminate early.
philosophers.py contains a basic setup for
dining philosophers.
However, currently all philosophers dine in order. Try enabling them to dine
concurrently using BocPy.
- BocPy website: https://microsoft.github.io/bocpy/
- BocPy documentation: https://microsoft.github.io/bocpy/sphinx/index.html
- BocPy examples with descriptions: https://github.com/microsoft/bocpy/blob/main/examples/README.md