This is the guessing-game example code from the
maturin
tutorial.
Clone the source:
git clone https://github.com/moto-timo/guessing-game
cd guessing-gameSet up a Python virtual environment:
python3 -m venv .venv
source .venv/bin/activateBuild and install in your virtual environment:
maturin developTest the module:
python3
>>> import guessing_game
>>> guessing_game.guess_the_number()To build a wheel:
maturin buildTo leave your virtual envirnoment:
deactivate