Using Python to Interact with the Operating System (Coursera)

Offered by Google,
Using Python to Interact with the Operating System (Coursera)

By the end of this course, you’ll be able to manipulate files and processes on your computer’s operating system. You’ll also have learned about regular expressions -- a very powerful tool for processing text files -- and you’ll get practice using the Linux command line on a virtual machine. And, this might feel like a stretch right now, but you’ll also write a program that processes a bunch of errors in an actual log file and then generates a summary file. That’s a super useful skill for IT Specialists to know.

Class Deals by MOOC List - Click here and see Coursera's Active Discounts, Deals, and Promo Codes.

We’ll kick off by exploring how to execute Python locally, and organize and use code across different Python files. We'll then learn how to read and write different types of files, and use subprocesses and input streams. We'll also dive into Bash scripting and regular expressions -- both very powerful tools for anyone working with systems. We'll even touch on automatic testing, which allow us to automate how we check if our code is correct. To finish, we’ll put all this together by using the tools that we’ve acquired to process data and generate automatic reports.
We’ll also explain how to set up your own developer environment in your machine. This is a key step in being able to write and deploy powerful automation tools.

What You Will Learn

  • Setup, configure, and use your own developer environment in Python
  • Manipulate files and processes running on the Operating System using Python
  • Understand and use regular expressions (regex), a powerful tool for processing text files
  • Know when to choose Bash or Python, and create small scripts using Bash

Course 2 of 6 in the Google IT Automation with Python Professional Certificate

Syllabus

WEEK 1
Getting Your Python On
In this module, you’ll learn about the different types of operating systems, and how you can get your python code ready to interact with the operating system. We’ll learn about getting your environment set up and installing additional Python modules that will help you along the way. We’ll rundown interpreted versus compiled language, and how they differ from each other. We’ll dive into the benefits of automation, and point out common pitfalls so you can avoid them. Finally, we’ll learn about Qwiklabs, which will be used for graded assessments.

WEEK 2
Managing Files with Python
In this module, you’ll learn about reading and writing to files and the commands that will enable you to do this. We’ll learn the importance of managing files and how we can navigate through different directories. We’ll understand how to work with files and how there is a layer of abstraction between Python and the operating system. Finally, we’ll dive into learning about CSV files and how to best utilize them.

WEEK 3
Regular Expressions
In this module, you’ll learn about what a regular expression is and why you would use one. We’ll dive into the basics of regular expressions and give examples of wildcards, repetition qualifiers, escapare characters, and more. Next up, we’ll explore advanced regular expressions and deep dive on repetition qualifiers. You’ll tackle new exercises like capturing groups and extracting PIDs using regexes. Finally, we’ll provide a cheat sheet to serve as your go-to guide for regular expressions.

WEEK 4
Managing Data and Processes
In this module, we’ll learn about reading and writing to data files based on an interaction with the user. Along the way, we’ll dive into standard streams, environment variables, and command line arguments. Next, we’ll jump into Python subprocesses, including system commands and how they can be used. We’ll review how to obtain output from a system command, and dive into subprocess management, including how to check exit values and manipulate the normal versus error exit values. Finally, we’ll rundown processing log files, and will cover what a log file is, how to filter log files using regular expressions, and how to understand the output captured from log files.

WEEK 5
Testing in Python
In this module, you’ll learn how to create tests in Python. We’ll cover what testing is all about and dive into the differences between manual versus automated testing. Next, we’ll explore what unit tests are intended to do and how to write them. Then, we’ll learn about other test concepts like black box versus white box tests and how test-driven development can frame how you design and write your code. Finally, you’ll learn about errors and exceptions, and how to combat them.

WEEK 6
Bash Scripting
In this module, you’ll be exposed to what the Linux OS has to offer and you'll learn about Bash scripting. We’ll go over basic Linux commands and explore the many processes Linux has to offer, including a key concept called redirection. We’ll then deep dive into creating bash scripts using variables and globs. Finally, we’ll learn about advanced bash concepts and develop an understanding of when to use bash versus Python.

WEEK 7
Final Project
In this module, you’ll put everything you’ve learned so far into action! You’ll apply your scripting knowledge to tackle a challenging final project: writing a script that scans for a specific error in the log files.
You'll create a problem statement to understand the challenge, conduct some research to see what options are available, then begin planning how you intend to solve the problem. Lastly, you'll write the code to implement your solution!

Go to Class
MOOC List is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Related Courses

Kotlin for Java Developers (Coursera) Coursera
JetBrains

Kotlin for Java Developers (Coursera)

The Kotlin programming language is a modern language that gives you more power for your everyday tasks. Kotlin is concise, safe, pragmatic, and focused on interoperability with Java code. It can be used almost everywhere Java is used today: for server-side development, Android apps, and much more. This course aims to share with you the power and the beauty of Kotlin.

Aug 17th 2026
5-12 Weeks
Introduction to Open Source Application Development (Coursera) Coursera
Illinois Tech

Introduction to Open Source Application Development (Coursera)

This course introduces basic concepts of systems programming using a modern open source language. You will learn to apply basic programming concepts toward solving problems, writing pseudocode, working with and effectively using basic data types, abstract data types, control structures, code modularization and arrays. You will learn to detect errors, work with variables and loops, and discover how functions, methods, and operators work with different data types. You will also be introduced to the object paradigm including classes, inheritance, and polymorphism.

Aug 17th 2026
5-12 Weeks
Basic Modeling for Discrete Optimization (Coursera) Coursera
University of Melbourne,The Chinese University of Hong Kong

Basic Modeling for Discrete Optimization (Coursera)

Optimization is a common form of decision making, and is ubiquitous in our society. Its applications range from solving Sudoku puzzles to arranging seating in a wedding banquet. The same technology can schedule planes and their crews, coordinate the production of steel, and organize the transportation of iron ore from the mines to the ports. Good decisions in manpower and material resources management also allow corporations to improve profit by millions of dollars.

Aug 17th 2026
4 Weeks
COBOL Programming with VSCode (Coursera) Coursera
IBM

COBOL Programming with VSCode (Coursera)

Professor Tak Auyeung of American River College, said it beautifully, “A programming language is not a fashion statement” it is used for a purpose. Whether it is to add new features, modify logic, create APIs to integrate it into other applications, or implement modern development practices, businesses around the world need application developers who know COBOL.

Aug 17th 2026
3 Weeks
Creative Programming for Digital Media & Mobile Apps (Coursera) Coursera
University of London,Goldsmiths, University of London

Creative Programming for Digital Media & Mobile Apps (Coursera)

This course is for anyone who would like to apply their technical skills to creative work ranging from video games to art installations to interactive music, and also for artists who would like to use programming in their artistic practice. This course will teach you how to develop and apply programming skills to creative work. This is an important skill within the development of creative mobile applications, digital music and video games. It will teach the technical skills needed to write software that make use of images, audio and graphics, and will concentrate on the application of these skills to creative projects. Additional resources will be provided for students with no programming background.

Aug 17th 2026
5-12 Weeks
Introduction to Hardware and Operating Systems (Coursera) Coursera
IBM

Introduction to Hardware and Operating Systems (Coursera)

Organizations need workers who can help others with computer hardware, software, and connectivity issues. Healthcare organizations are still converting to digitized systems, requiring more IT support. Workers are retiring, and organizations are contracting workers through IT consultancies rather than in-house IT technicians. With remote and hybrid work here to stay, organizations must provide employees with the devices and support they need to remain connected and productive. Additionally, IT support roles are often a steppingstone that enables employees to grow into higher-paying IT careers.

Aug 17th 2026
5-12 Weeks
Understanding and Applying Text Embeddings (Coursera) Coursera
DeepLearning.AI

Understanding and Applying Text Embeddings (Coursera)

The Vertex AI Text-Embeddings API enhances the process of generating text embeddings. These text embeddings, which are numerical representations of text, play a pivotal role in many tasks involving the identification of similar items, like Google searches, online shopping recommendations, and personalized music suggestions.

Aug 17th 2026
1 Week
Selenium WebDriver with Python (Coursera) Coursera
Whizlabs

Selenium WebDriver with Python (Coursera)

“Selenium WebDriver with Python” is a foundational course that aims to provide a comprehensive understanding of Selenium and its components. It also helps in understanding how Selenium WebDriver Operates. This course begins by demonstrating an environment setup for Selenium WebDriver with Python. A brief description of locating Web elements and web Interactions is provided in this course. This course covers an overview of testing frameworks with Selenium WebDriver. Some advanced topics such as Handling Popup, Alerts, Multiple Browser Tabs, Mouse and Keyboard interactions are also highlighted in this course.

Aug 17th 2026
3 Weeks