Tools for your colleagues: CLI and GUI

A script only you can run is a script only you will use. We turn working code into proper tools: a command line with help and sensible defaults, a nice terminal interface, a small window for those who never open a terminal, and a way to install it on a colleague's machine without a lecture on virtualenvs.

Duration: 2 or 3 days · Level: intermediate

For: anyone who writes Python scripts that other people, technical or not, need to run.

Prerequisites: knowing the basics of Python: functions, modules, files.

Tools for your colleagues: CLI and GUI

Day 1 — Proper command lines

  • What makes a tool pleasant to use
  • Arguments, options and sub-commands with argparse
  • Settings from the CLI, env and .env with pydantic-settings
  • Configuration files: TOML and where to put them
  • Exit codes, stdin, stdout and stderr: playing nice with pipes
  • Logging vs printing
  • Colours, tables and progress bars with rich
  • Readable tracebacks with rich
  • Testing a CLI with pytest

Day 2 — Interfaces

  • Terminal user interfaces with textual
  • Widgets, layouts and styling in textual
  • Reacting to events
  • Running long tasks without freezing the interface
  • A first desktop window with Tkinter
  • The same with PySide: when it's worth it
  • Forms, file pickers and dialogs
  • Separating the logic from the interface

Day 3 — Optional: distribution

  • Packaging your tool with pyproject.toml
  • Entry points: one command to launch it
  • Installing with uv tool and pipx
  • Single-file scripts with uv inline dependencies
  • One executable with Nuitka or PyInstaller
  • Locked-down Windows machines: WinPython
  • Updating a tool already in users' hands
  • Writing a README people actually read

Elevate Your Python Proficiency!