Posts
Python Basics: Understanding Shallow and Deep Copies
Before changing a list or dictionary, you may want a separate version. Python’s standard-library copy module helps control which parts become independent. Use Python 3.12 or newer …
October 12, 2026
Python Basics: Splitting Quoted Text with shlex
A small text command might contain a filename with spaces. Python’s standard-library shlex module helps separate words while respecting shell-style quotes. Use Python 3.12 or newer …
October 12, 2026
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 …
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 …
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 …
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 …
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 …
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 …
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 …
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 …
October 12, 2026