Student materials for the TNO Python Course
  • HTML 77.4%
  • Python 22.6%
Find a file
2026-06-29 21:38:24 +00:00
.vscode Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
articles Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
books Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
demos Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
solutions Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
starter Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
.gitignore Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
README.md Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Advanced-Exercises.html Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Advanced-Exercises.pdf Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Advanced.html Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Advanced.pdf Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-DataScience-Exercises.html Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-DataScience-Exercises.pdf Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-DataScience.html Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-DataScience.pdf Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Intro-Exercises.html Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Intro-Exercises.pdf Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Intro.html Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00
TNO-Python-Intro.pdf Update student materials from main commit 2bc7396 2026-06-29 21:38:24 +00:00

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 more
    • TNO-Python-DataScience.pdf : NumPy, pandas and matplotlib
  • Exercises (PDF) : the lab guide for each part, with the same names plus -Exercises, for example TNO-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 example demos/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/ and articles/ : 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 :

  1. 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
      
  2. Install the interpreter the course uses : uv python install 3.14
  3. 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.