Repository navigation
Getting Started
This page gets PyICs running and shows you a course from the student's side. That is the quickest way to see what you will be building.
PyICs needs Python 3.14 or newer. A virtual environment per course (or per semester) is recommended: your course's tests run in the same Python environment as PyICs, so any packages your course needs (e.g. numpy) must be installed there too.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install python-interactive-courses
pyics --helppyics --help lists every command. Each command has its own help too, e.g. pyics create_task --help. See the Command Reference for all of them.
The PyICs repository includes a small course, Search Algorithms, with two tasks: depth-first search and breadth-first search.
git clone https://github.com/johannes-langer/PyICs
cd PyICs
pyicspyics without a command opens the app. It starts with a course selector that lists the course manifests (*.pyicscourse.json) in the working directory and up to two levels below it. Choose Search Algorithms.
What happens next is what your students will see:
- The course opens at its first unsolved task. PyICs creates the task's exercise file (here
.exercises/dfs.py) from the starter code stored in the task. An exercise file that already exists is never overwritten, so students never lose work. - The header shows the task's instructions. The main panel shows a link to the exercise file and the tests that currently fail.
- Open the exercise file in any editor, change it and save. The tests run again on every save.
- Once every test passes, the task is solved and n moves on to the next one.
There is also a notebook version of the same course in examples/search_notebook (see Jupyter Notebooks).
| Key | Action |
|---|---|
| n | Next task (once the current one is solved, unless the course allows free navigation) |
| p | Previous task |
| h | Show the next hint of the task |
| t | Turn tracing of failed tests on or off: shows each line the student's code ran, with variable values and calls |
| c | Back to the course selector (esc there returns to the course) |
| ctrl+c | Quit |
Failing tests are red. Failing soft tests are yellow: they are warnings and don't keep a task from counting as solved.
A course is made of tasks. For each task, you provide:
- a name and instructions (shown in the header),
- optional hints, revealed one at a time with h,
- one or more exercise files with starter code (Python files or Jupyter notebooks),
- optional solution files,
- tests that decide when the task is solved.
You create all of this with interactive commands. You don't write JSON by hand:
| Command | Does |
|---|---|
pyics create_task |
create a task (Creating Tasks) |
pyics create_course |
create a course from tasks (Creating Courses) |
pyics edit_task, pyics edit_course
|
change them later |
pyics pack, pyics build_index
|
package and publish the course (Distributing Courses) |
Next: How Courses Work explains the files these commands create.
PyICs instructor wiki · Generated from the wiki/ directory of the repository: edit the pages there, not here. · Report a problem