The Python Crown

Short, example-driven guides to one Python idea at a time.

Written by Jack Coulter. Every example runs, and nothing needs a package you have to install.

.py

Python File Handling

Reading, writing, and organizing files

A short, example-driven guide to working with files in Python: opening them safely, handling text and encodings, using pathlib for paths, and reading and writing CSV and JSON. Nothing here needs a package you have to install, and every example was run when the book was built. By the end you can get data in and out of a file without looking it up.

.py

Object-Oriented Python

Classes, dunder methods, and dataclasses

A focused, example-driven guide to classes in Python: __init__ and self, the dunder methods that make a class behave like a built-in type, class methods, inheritance versus composition, properties, and dataclasses. Standard library only, and every example was run when the book was built. By the end you can read a class-based codebase and design your own small class hierarchy without guessing.

A new book, once in a while

One email when a new guide is out. Nothing else.