Skip to content

Student Quick Guide

github-actions[bot] edited this page Nov 13, 2026 · 2 revisions

Student Quick Guide

For instructors: this page is written for your students. Link to it, or copy it into your course page and fill in the parts in angle brackets.


Setup

You need Python 3.14 or newer and an environment for the course, where PyICs and the packages the course needs are installed.

Recommended: uv

If you are new to PyICs (or to Python), use uv. It installs the right Python for you, even if you don't have Python yet.

  1. Install uv (once per computer):

    # macOS and Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    # Windows (PowerShell)
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

    Then open a new terminal, so that the uv command is found. Other ways to install it are listed in the uv documentation.

  2. In the folder where you want to keep the course, create the environment and install PyICs:

    uv venv --python 3.14            # creates .venv, and downloads Python 3.14 if needed
    source .venv/bin/activate        # Windows: .venv\Scripts\activate
    uv pip install python-interactive-courses

Activate the environment again (the second command) every time you open a new terminal to work on the course.

Already comfortable with Python? pip works too

If Python 3.14 or newer is already installed, you can use venv and pip instead:

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install python-interactive-courses

Getting the course

Your instructor gives you one of these:

  • A course library (once per environment):

    pyics add_source <index URL>
    pyics search                   # lists the courses; "pyics search graphs" finds matching ones
    pyics pull <course name>       # pulls it into ./<course name>
    cd <course name>
  • A course archive (.zip): pyics pull <URL or path of the zip>, then cd into the new directory.

  • The course files: just cd into their directory.

If the course needs other packages, pyics pull tells you which, and how to install them (--install_deps installs them after asking). Install them in the same environment as PyICs. An environment created by uv has no pip: install packages into it with uv pip install <package> while it is activated.

Courses run code on your computer. Only add sources and pull courses from people you trust.

Working on the course

Start the app in the course's directory:

pyics

Choose the course. It opens at your first unsolved task:

  1. The header shows the task's instructions. The main panel shows a link to your exercise file and the tests that still fail.
  2. Open the exercise file in your editor and work on it.
  3. Save the file. The tests run again every time you save.
  4. When all tests pass, the task is solved. Press n for the next one.

Red tests have to pass. Yellow tests are warnings: worth fixing, but they don't stop you from moving on.

Key Action
n next task (once this one is solved, unless the course lets you skip)
p previous task
h show the next hint
t trace failed tests: shows every line your code ran, the values of variables, and the calls it made. Press again to turn it off.
c course selector (esc returns to the course)
ctrl+c quit; your progress is kept

Your work is never overwritten. To start a task over, delete its exercise file; it is recreated when you open the task again.

Getting updates

When your instructor publishes a new version of a course you pulled, run this in the course's directory:

pyics update

Your exercise files and your progress are kept.

Jupyter notebooks

  • When Jupyter or VS Code asks for a kernel, choose the environment where PyICs is installed (the .venv folder you created in Setup).
  • Save the notebook (ctrl+s) to run the tests. Running a cell isn't enough.
  • The tests run all cells from the top, like Restart Kernel and Run All Cells. An error in one cell doesn't stop the others, and failed tests name the cell that raised, e.g. cell 7 raised NameError. Cells are counted from the top, markdown cells included.
  • Don't delete the description cells of exercises: they mark where each exercise starts.
  • Cells tagged skip-execution don't run in tests.

Course libraries (sources)

Command Does
pyics sources lists your sources
pyics remove_source <name> removes one
pyics search [term] [--offline] lists the courses of your sources

Sources are stored per environment: in a virtual environment, in its etc/pyics/sources.json. Outside one, in your PyICs configuration directory (~/.config/pyics on Linux, ~/Library/Application Support/pyics on macOS, %APPDATA%\pyics on Windows). The PYICS_CONFIG_DIR environment variable sets another one.

The course selector also lists the courses of your sources that you haven't pulled yet. Selecting one pulls it.

Clone this wiki locally