Python Quest

Track 15 · Lesson 7 of 11

Configuration files

Move paths, thresholds and switches out of the code into JSON, INI or TOML configuration files, with sensible defaults and validation.

About 50 minIntermediate4 exercises

You will be able to

  • Explain which values belong in configuration rather than in code
  • Read settings from JSON, INI (configparser) and TOML (tomllib) files
  • Merge defaults, configuration files and command-line overrides in the right order
  • Validate a configuration and report every problem clearly before the script does any work

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.