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

Problem Solving, Python Programming, and Video Games (Coursera) Coursera
University of Alberta

Problem Solving, Python Programming, and Video Games (Coursera)

This course is an introduction to computer science and programming in Python. Important computer science concepts such as problem solving (computational thinking), problem decomposition, algorithms, abstraction, and software quality are emphasized throughout. The Python programming language and video games are used to demonstrate computer science concepts in a concrete and fun manner. However, a learner can take the knowledge and skills from this course and apply them to non-game problems, other programming languages, and other computer science courses.

Sep 21st 2026
5-12 Weeks
Exam Prep AI-102: Microsoft Azure AI Engineer Associate (Coursera) Coursera
Whizlabs

Exam Prep AI-102: Microsoft Azure AI Engineer Associate (Coursera)

The AI-102: Designing and Implementing a Microsoft Azure AI Solution certification exam tests the candidate’s experience and knowledge of the AI solutions that make the most of Azure Cognitive Services and Azure services. In addition, the exam also tests the candidate's ability to implement this knowledge by participating in all phases of AI solutions development—from defining requirements, and design to development, deployment, integration, maintenance, performance tuning, and monitoring.

Sep 21st 2026
5-12 Weeks
Developing AI Applications on Azure (Coursera) Coursera
LearnQuest

Developing AI Applications on Azure (Coursera)

This course introduces the concepts of Artificial Intelligence and Machine learning. We'll discuss machine learning types and tasks, and machine learning algorithms. You'll explore Python as a popular programming language for machine learning solutions, including using some scientific ecosystem packages which will help you implement machine learning.

Sep 21st 2026
5-12 Weeks
Embedded Hardware and Operating Systems (Coursera) Coursera
EIT Digital

Embedded Hardware and Operating Systems (Coursera)

This course is intended for the Bachelor and Master's students, who like practical programming and making IoTs applications! In this course we will talk about two components of a cyber physical system, namely hardware and operating systems. After completing this course, you will have the knowledge of both hardware components and operating systems. You are able to plan and use embedded operating systems in resource-constraint devices for Internet-of-Things (cyber physical system) applications.

Sep 21st 2026
4 Weeks
Machine Learning: Concepts and Applications (Coursera) Coursera
University of Chicago

Machine Learning: Concepts and Applications (Coursera)

This course gives you a comprehensive introduction to both the theory and practice of machine learning. You will learn to use Python along with industry-standard libraries and tools, including Pandas, Scikit-learn, and Tensorflow, to ingest, explore, and prepare data for modeling and then train and evaluate models using a wide variety of techniques. Those techniques include linear regression with ordinary least squares, logistic regression, support vector machines, decision trees and ensembles, clustering, principal component analysis, hidden Markov models, and deep learning.

Sep 21st 2026
5-12 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.

Sep 14th 2026
5-12 Weeks
VLSI CAD Part I: Logic (Coursera) Coursera
University of Illinois at Urbana-Champaign

VLSI CAD Part I: Logic (Coursera)

A modern VLSI chip has a zillion parts -- logic, control, memory, interconnect, etc. How do we design these complex chips? Answer: CAD software tools. Learn how to build thesA modern VLSI chip is a remarkably complex beast: billions of transistors, millions of logic gates deployed for computation and control, big blocks of memory, embedded blocks of pre-designed functions designed by third parties (called “intellectual property” or IP blocks). How do people manage to design these complicated chips? Answer: a sequence of computer aided design (CAD) tools takes an abstract description of the chip, and refines it step-wise to a final design.

Sep 21st 2026
5-12 Weeks
Developing Android Apps with App Inventor (Coursera) Coursera
The Hong Kong University of Science and Technology - HKUST

Developing Android Apps with App Inventor (Coursera)

The course will give students hands-on experience in developing interesting Android applications. No previous experience in programming is needed, and the course is suitable for students with any level of computing experience. MIT App Inventor will be used in the course. It is a blocks-based programming tool that allows everyone, even novices, to start programming and build fully functional apps for Android devices. Students are encouraged to use their own Android devices for hands-on testing and exploitation.

Sep 21st 2026
5-12 Weeks
An Introduction to Programming using Python (Coursera) Coursera
University of Leeds

An Introduction to Programming using Python (Coursera)

Maximise your employability, by learning the basics of coding in Python. Python is a versatile programming language used for developing websites and software, task automation, data analysis and more. In this course, you'll embark on an exciting journey into the world of Python and gain valuable skills that will enable you to start thinking about a career in programming.

Sep 21st 2026
2 Weeks
Functions, Tools and Agents with LangChain (Coursera) Coursera
DeepLearning.AI

Functions, Tools and Agents with LangChain (Coursera)

The landscape of LLMs and the libraries that support them has evolved rapidly in recent months. This course is designed to keep you ahead of these changes. You’ll explore new advancements like ChatGPT’s function calling capability, and build a conversational agent using a new syntax called LangChain Expression Language (LCEL) for tasks like tagging, extraction, tool selection, and routing.

Sep 21st 2026
1 Week
Videojuegos: ¿de qué hablamos? (Coursera) Coursera
Universitat Autònoma de Barcelona

Videojuegos: ¿de qué hablamos? (Coursera)

Probablemente, todos hemos jugado a algún videojuego, pero ¿qué hay detrás de él? Podemos decir que - con independencia del videojuego - hay un árduo trabajo multidisciplinar que incluye desde aspectos de diseño hasta la programación como tal del videojuego. Este curso pretende ser un curso introductorio que muestre qué aspectos hay que considerar en el videojuego, y que permita con posterioridad abordar individualmente los temas que se consideran nucleares: diseño, arte, motor del videojuego y 'game play'.

Sep 21st 2026
5-12 Weeks