Skip to content

Posts

Python Basics: Matching Filename Patterns with fnmatch

Imagine receiving a list of export filenames and needing only the daily sales reports. Python’s standard-library fnmatch module checks strings against shell-style patterns. It does …

Read more →

October 12, 2026

Python Basics: Inspecting Data with pprint

A long dictionary can be hard to scan in a terminal. Python’s pprint module formats nested data across lines, making it easier to inspect a script’s intermediate results. Use …

Read more →

October 12, 2026

Python Basics: Comparing Text with difflib

A misspelled command or a changed settings line can be easier to handle with a small comparison tool. Python’s standard-library difflib module supplies suggestions, readable …

Read more →

October 12, 2026

Python Basics: Validating IP Addresses and Subnets with ipaddress

Python’s standard-library ipaddress module turns address text into objects you can validate, compare, and check against a subnet. Use Python 3.12 or newer in Bash on Linux. Each …

Read more →

October 12, 2026

Python Basics: Reading INI Settings with configparser

An INI file groups settings under section headings such as [app]. Python’s standard-library configparser module reads these settings and converts common value types. Use Python …

Read more →

October 12, 2026

Python Basics: Reading and Writing Compressed Text with gzip

Python’s standard-library gzip module reads and writes compressed text, including logs and exports saved as .gz files. Use Python 3.12 or newer in Bash on Linux. Examples run …

Read more →

October 12, 2026

Python Basics: Managing Cleanup with contextlib

An open file needs closing even when processing fails. Python’s with statement gives that cleanup a clear place. Start with built-in context managers, then use contextlib when a …

Read more →

October 12, 2026

Python Basics: Building and Reading URLs with urllib.parse

Python’s standard-library urllib.parse module separates URL components and encodes values containing spaces or special characters. Use Python 3.12 or newer in Bash on Linux. These …

Read more →

October 12, 2026

Python Basics: Taking the Next Item with heapq

A queue of jobs often needs the most urgent item next. Python’s heapq module maintains a heap in a list, with the smallest item at index zero. Use Python 3.12 or newer on Linux. …

Read more →

October 12, 2026

Python Basics: Summarizing Measurements with statistics

A few summary numbers can make a small set of measurements easier to inspect. Python’s standard-library statistics module handles common averages and measures of spread. Use Python …

Read more →

October 12, 2026