A practical, community-driven guide to Python 3 for system administrators and DevOps engineers. Each chapter teaches one module through the tasks you actually do on servers: reading configs and logs, running commands, checking disks and ports, and building your own command-line tools.
📖 Read it as a website: purutuladhar.com/python-for-sys-admin
⭐ If this guide helps you, please give it a star. It helps other sysadmins find it.
You don't need a server. The iximiuz Labs Python Playground gives you a real Linux VM with root access, the latest Python 3, uv, Docker and VS Code, right in your browser. Start it, then:
git clone https://github.com/tuladhar/Python-for-SysAdmin.git
cd Python-for-SysAdmin/examples
cat /etc/passwd | python3 grep.py bashStuck on a concept? Install the free /step-by-step Claude skill. It explains any topic one short sentence at a time, and waits for you to say "understood" before it moves on:
/step-by-step how subprocess.run captures stdout and the exit code
- The
osModule - The
sysModule shutilandglob- Date and Time
- Running Commands with
subprocess - Building CLIs with
argparse
Regular expressions, logging, compression, XML, platform, signals, ipaddress, concurrency, HTTP APIs, SSH automation (paramiko), psutil, netmiko, boto3, Docker and Kubernetes clients, Jinja2 templating, and testing with pytest.
All runnable scripts are in examples/.
This guide is written by the community. Fixing a typo is as welcome as writing a new chapter. Merged chapters appear on the website automatically. Read CONTRIBUTING.md to get started, or open an issue to propose a topic.
- Author: Puru Tuladhar
- And everyone who contributed ❤️
Licensed under the terms in LICENSE.