- HTML 77.4%
- Python 22.6%
| .vscode | ||
| articles | ||
| books | ||
| demos | ||
| solutions | ||
| starter | ||
| .gitignore | ||
| README.md | ||
| TNO-Python-Advanced-Exercises.html | ||
| TNO-Python-Advanced-Exercises.pdf | ||
| TNO-Python-Advanced.html | ||
| TNO-Python-Advanced.pdf | ||
| TNO-Python-DataScience-Exercises.html | ||
| TNO-Python-DataScience-Exercises.pdf | ||
| TNO-Python-DataScience.html | ||
| TNO-Python-DataScience.pdf | ||
| TNO-Python-Intro-Exercises.html | ||
| TNO-Python-Intro-Exercises.pdf | ||
| TNO-Python-Intro.html | ||
| TNO-Python-Intro.pdf | ||
TNO Python Course
Welcome. This bundle contains everything you need for the 5-day Python course : the slides, the lab exercises, runnable example code, reference solutions and a small library of books and articles. This page explains what is in the zip and how to run things.
What is in this bundle
- Slides (PDF) : the course decks, one per part.
TNO-Python-Intro.pdf: basic Python (the first days)TNO-Python-Advanced.pdf: classes, typing, testing and moreTNO-Python-DataScience.pdf: NumPy, pandas and matplotlib
- Exercises (PDF) : the lab guide for each part, with the same names plus
-Exercises, for exampleTNO-Python-Intro-Exercises.pdf. Start each part at Exercise 0 (Environment Setup) in the Intro exercises. demos/: the runnable example programs shown on the slides, one folder per topic (for exampledemos/01.intro-to-python/).solutions/: a reference solution for each exercise, in case you get stuck or want to compare. Try the exercise first.books/andarticles/: optional background reading.
You will create your own project for the code you write during the week; the bundle does not ship one (see below).
Setting up Python
Full step-by-step instructions are Exercise 0 in
TNO-Python-Intro-Exercises.pdf. The short version :
- Install uv, the Python project manager (it
can also install Python) :
- Windows (PowerShell) :
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" - macOS or Linux :
curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows (PowerShell) :
- Install the interpreter the course uses :
uv python install 3.14 - Install VS Code (any editor works, but the slides assume VS Code). When you open this bundle's folder in VS Code it will offer to install the recommended extensions, the Microsoft Python extension and the Astral Ruff extension; accept it.
Creating your own project
You build your own project for the code you write this week, the same way you
will in real work. The bundle does not include a pyproject.toml or a
requirements.txt on purpose, you create the project and add packages yourself :
uv init course-work
cd course-work
uv add pydantic pytest numpy pandas matplotlib
Those five packages are everything the week needs. uv add writes them into the
pyproject.toml it created and pins Python 3.14 for the project.
Running a demo
Most demos are plain scripts. From your project, run one by giving its path :
uv run python /path/to/demos/01.intro-to-python/02_basic_type_syntax/02_basic_type_syntax.py
Using uv run guarantees the command uses your project's Python 3.14 and the
packages you installed, so you never have to activate anything by hand.
Doing the exercises
Open the exercises PDF for the part you are on and work through the numbered
steps. Each exercise builds a little Car program a step at a time, so keep your
files between exercises. When you want to check your work, the matching folder
under solutions/ has a worked answer.
Running the tests
Some exercises ask you to write tests. Run them from your project with :
uv run pytest
That is everything. If a download is blocked on the company network, see the troubleshooting note at the end of Exercise 0. Enjoy the course.