The Quiet Terminal

Notes on Python, one small script at a time.

Practical Tips

Date ranges and workday lists without a calendar library

2026-09-11

Business days between two dates with nothing but datetime and a list comprehension.

Pulling emails and links out of text with re

2026-09-04

Two patterns worth memorizing — and the advice to stop before the pattern becomes a second program.

pathlib: the file-handling upgrade I wish I'd found sooner

2026-08-21

Stop gluing path strings together by hand. A tour of the object-oriented way to move, rename, and sort files.

sqlite3: the tiny database you already have

2026-08-14

A real database, zero setup. CRUD with the ? placeholders that keep your data honest.

Sorting a messy Downloads folder with a twenty-line script

2026-08-07

A folder for everything, dry-run included, name collisions handled.

Keeping secrets out of your code with .env files

2026-07-24

API keys out of your source code and into a file git never sees.

Catch what you can handle, raise what you can't

2026-07-17

The one rule that cleans up most exception handling, plus the bare-except trap.

Calling system commands from Python with subprocess

2026-07-10

Capture output, fail loudly, and skip the shell-string foot-guns.

Five ways to run a Python script on a schedule

2026-06-26

cron, Task Scheduler, sleep-loops, sched, APScheduler — and when each one is the right answer.

Four ways to batch-rename files (and the one I use)

2026-06-12

From brute force to clean, with a dry-run version you can actually trust.

Your first automated test with pytest

2026-06-05

One assert, one command, and the habit that follows.

dataclass: the end of twelve-line __init__ methods

2026-05-29

Delete your boilerplate. Nobody gets hurt.

argparse: give your scripts a real command line

2026-05-22

From sys.argv[1] to flags and a --help page you didn't have to write.

Retiring print(): a ten-minute migration to logging

2026-05-08

The upgrade that pays for itself the first time something breaks at 3am.

Four containers from collections that earn their keep

2026-04-24

Counter, defaultdict, deque, namedtuple — small tools, outsized payoffs.

Calling an HTTP API with requests: the parts that matter

2026-04-17

The calls you'll actually make, including the timeout argument people forget.

Reading and writing JSON config files, the boring reliable way

2026-04-03

Readable, mergeable, diffable — config as data instead of constants.

The csv module is still the right tool for small table jobs

2026-03-20

DictReader, DictWriter, and the newline='' fix for Windows blank lines.

venv, explained by the two projects that broke each other

2026-03-06

Two projects, one machine, zero dependency wars.

Getting a small script onto a Linux server properly

2026-02-20

scp, venv, cron, logs — five mistakes I made so your script doesn't have to.

Beginner

Project: a command-line to-do list from scratch

2026-09-16

A complete, runnable build — every beginner concept used once, end to end.

pip: installing the good stuff without wrecking your system

2026-08-28

Installing, listing, uninstalling — and the fix for the too-many-packages problem.

Classes in one page: a minimal, honest example

2026-08-03

One small class, self explained plainly, and when a class is overkill.

Reading a Python traceback from the bottom up

2026-07-30

That red wall of text isn't scolding you — it's a map. How to find the "what" and the "where" in three seconds.

try/except: failing without dying

2026-07-22

Wrap the risky line, catch the specific error, keep the program alive.

None, is, and ==: a short story about identity

2026-07-08

== compares values, is compares identity — and None sits right on the fault line.

Dictionaries: looping, updating, and surviving keys

2026-07-01

Looping with .items(), defaults with .get(), and your first KeyError.

List comprehensions, translated from loops

2026-06-23

A loop translated into one honest line — and when to translate it back.

Split, strip, join: everyday string moves

2026-06-18

The workhorse methods you'll use every single day, plus f-strings.

Reading and writing files, the with-block way

2026-06-04

The with-block, the three modes, and a notes file that survives the process.

Modules and import: borrowing code the Python way

2026-05-28

The standard library as a toolbox — and your own files as modules.

Functions: parameters, returns, and the print-vs-return trap

2026-05-21

def, parameters, returns — and the confusion that costs every beginner an afternoon.

for and while: making the computer repeat itself

2026-05-15

Repetition without copy-paste: enumerate, break, and the off-by-one habit.

if, elif, else: teaching your program to decide

2026-04-30

Comparisons, elif chains, and the truthiness of empty things.

Lists, tuples, sets, and dicts: which one when?

2026-04-10

A decision table instead of memorization.

Variables, strings, numbers, and booleans

2026-03-27

Names are labels — and your first TypeError is a rite of passage.

print(), comments, and other habits worth starting early

2026-03-13

Comments are letters to your future self. Write them like it.

Your first Python program in VS Code

2026-02-27

hello.py, the Run button, and the terminal — two ways to start a habit.

Installing Python on Windows (and meeting PATH for the first time)

2026-02-13

The installer, the checkbox, and the Microsoft Store trap.

What is Python, and what is it actually good for?

2026-02-06

An honest scope: what it's great at, what it isn't, and why that matters.