Skip to content

Posts

Python Basics: Hashing Files with SHA-256

A file digest helps detect whether bytes have changed. Python’s standard-library hashlib can calculate a SHA-256 digest without loading the entire file into memory. Use Python 3.12 …

Read more →

October 11, 2026

Python Basics: Creating and Inspecting ZIP Archives

Python’s standard-library zipfile module can create a ZIP archive, list its members, and read a selected file without extracting it. Use Python 3.12 or newer on Linux. The example …

Read more →

October 11, 2026

Python Basics: Counting and Grouping with collections

Counting repeated values and grouping records are common jobs in small scripts. Python’s standard-library collections module provides Counter and defaultdict to keep that code …

Read more →

October 11, 2026

Python Basics: Testing a Function with unittest

Python’s standard-library unittest module checks behavior automatically. Use Python 3.12 or newer on Linux. Run the shell commands in order in the same shell, starting in a fresh …

Read more →

October 11, 2026

Python Basics: Running Commands with subprocess

Python’s standard-library subprocess module runs another program and collects its result. These Linux examples use Python 3.12 or newer and only launch small Python commands. Pass …

Read more →

October 11, 2026

Python Basics: Recording Events with logging

Python’s standard-library logging module records events with severity levels. A script can show important messages while keeping diagnostics quiet. Use Python 3.12 or newer on …

Read more →

October 11, 2026

Python Basics: Parsing Timestamps and Converting to UTC

Python’s standard-library datetime module parses timestamps, converts offsets, and calculates durations. These examples use Python 3.12 or newer on Linux. The saved scripts create …

Read more →

October 11, 2026

Python Basics: Creating Temporary Files with tempfile

Python’s standard-library tempfile module creates temporary files and directories for tests and intermediate results. Use Python 3.12 or newer on Linux. Each example creates a …

Read more →

October 11, 2026

Python Basics: Working with Files Using pathlib

Python’s standard-library pathlib module represents filesystem paths as objects. It can join paths, read small text files, and find matching filenames without building shell …

Read more →

October 11, 2026

Python Basics: Reading and Writing JSON Files

JSON is useful for small configuration files and data exchanged between programs. Python’s standard-library json module converts JSON into dictionaries, lists, and other Python …

Read more →

October 11, 2026