Python 3 Scripting for System Administrators

Course Instructor
course instructor image
Keith Thompson
A software craftsman with love for all things Linux. Whether it's writing large scale web applications, automating deployment pipelines, or merely creating scripts to do the tedious work, Keith is always looking to learn and improve himself as an engineer. This love of learning and growth manifested into an insatiable drive to teach and spread his love of technology with others.

Course Introduction

Getting Started

Course Introduction

00:02:43

About the Course Author

00:00:57

Connect with Us!

00:01:00

Course Features and Tools

00:05:02

Environment Setup

Setting up a Cloud Server Development Environment

00:12:08

Installing Python 3 on CentOS 7

00:08:28

(Optional) Installing Python 3 on Debian/Ubuntu

00:08:27

Introducing Python

History & Benefits of Python

00:07:10

What's the Deal with Python 3?

00:07:54

Just Enough Python

Running Python

Introducing the REPL for Rapid Experimentation

00:03:14

Creating and Running Python Scripts

00:08:09

Using Comments

00:03:49

Common Data Types

Strings

00:12:00

Numbers (int and float)

00:07:20

Booleans and None

00:04:04

Working with Variables

00:05:54

Lists

00:13:19

Tuples

00:05:38

Dictionaries (dicts)

00:10:17

Control Flow

Conditionals and Comparisons

00:12:52

The 'while' Loop

00:09:21

The 'for' Loop

00:10:53

Logic Operations

00:10:39

Exercise: Creating and Displaying Variables

00:30:00

Exercise: Working with If/Else

00:30:00

Exercise: Iterating Over Lists

00:30:00

Quiz: Python Basics

Scripting with Python 3

Basic Scripting

Reading User Input

00:06:57

Function Basics

00:06:39

Using Functions in Scripts

00:16:33

Using Standard Library Packages

00:12:39

Working with Environment Variables

00:06:12

Interacting with Files

00:19:35

Intermediate Scripting

Parsing Command Line Parameters

00:05:39

Robust CLIs with 'argparse' - Part 1

00:13:56

Robust CLIs with 'argparse' - Part 2

00:07:08

Handling Errors with try/except/else/finally

00:09:13

Exit Statuses

00:03:11

Execute Shell Commands from Python

00:12:47

Advanced Iteration with List Comprehensions

00:11:10

Useful Standard Library Packages

random & json

00:11:53

shutil & glob

00:16:57

re & math

00:15:58

Exercise: Creating and Using Functions

00:30:00

Exercise: Using the 'os' Package and Environment Variables

00:30:00

Exercise: Creating Files Based on User Input

00:30:00

Exercise: Handling Errors When Files Don't Exist

00:30:00

Exercise: Interacting with External Commands

00:30:00

Exercise: Setting Exit Status on Error

00:30:00

Quiz: Python Scripting and IO

Third-Party Packages

Using Pip and Virtualenv

Installing Third-Party Packages Using 'pip'

00:09:03

Virtualenv

00:05:07

Using Third-Party Packages in Your Scripts

00:14:34

Exercise: Installing Third-Party Packages

00:30:00

Exercise: Utilizing Third-Party Packages

00:30:00

Quiz: Python Packages and Dependencies

Creating a Larger Scripting Project

Planning & Project Structure

Examining the Problem & Prep Work

00:08:03

Planning Through Documentation

00:15:18

Initial Project Layout

00:14:01

Implementing Features with Test Driven Development

Introduction to TDD and First Tests

00:14:22

Implementing CLI Guided By Tests

00:22:54

Introduction to Mocking in Tests

00:12:03

Implementing PostgreSQL Interaction

00:11:26

Implementing Local File Storage

00:08:54

Implementing AWS Interaction

00:14:08

Integrating Features and Distributing the Project

Wiring the Units Together

00:19:00

Building and Sharing a Wheel Distribution

00:06:52

Exercise: Creating a Python Project

00:30:00

Exercise: Test Drive Building a CLI Parser

00:30:00

Exercise: Implementing User Management

02:00:00

Exercise: JSON Parsing and Exporting

01:30:00

Exercise: Creating the Console Script

00:30:00

Exercise: Building a Wheel Distribution

00:30:00

Quiz: Python Projects, Testing, and Distribution

Course Conclusion

Final Steps

What's Next?

00:01:12

Details

In this course, you will develop the skills that you need to write effective and powerful scripts and tools using Python 3. We will go through the necessary features of the Python language to be able to leverage its additional benefits in writing scripts and creating command line tools (data types, loops, conditionals, functions, error handling, and more). Beyond the language itself, you will go through the full development process including project set up, planning, and automated testing to build two different command line tools.

Study Guides

Instructor Deck

Community

Looking For Team Training?

Learn More