Using Python to Interact with the Operating System

所在平台: Coursera

课程主页: https://www.coursera.org/learn/python-operating-system

课程评论:没有评论

第一个写评论        关注课程

课程简介

课程名称:使用 Python 与操作系统交互 课程概述:完成本课程后,您将能够在计算机操作系统上操纵文件和进程。同时,您将学习正则表达式这一强大的文本文件处理工具,并在虚拟机上练习使用 Linux 命令行。此外,您还将编写一个处理实际日志文件中一系列错误的程序,并生成一个摘要文件。这是 IT 专业人士非常有用的技能。 课程内容将从如何在本地执行 Python 开始,并组织和使用不同 Python 文件中的代码。然后,我们将学习如何读取和写入不同类型的文件,并使用子进程和输入流。接下来,我们将深入了解 Bash 脚本和正则表达式,这两种工具对系统工作者非常重要。我们还将介绍自动化测试,以便自动检查代码的正确性。最后,您将运用所学工具处理数据并生成自动报告。 课程还将指导您如何在本机上设置开发者环境,这是编写和部署强大自动化工具的关键一步。 课程大纲: 1. **获取 Python 环境**:了解不同类型的操作系统,设置 Python 环境,安装必要模块,了解解释型与编译型语言的区别及自动化的好处。 2. **使用 Python 管理文件**:学习读取和写入文件的重要命令,如何管理文件及导航目录,了解 Python 与操作系统之间的抽象层,以及如何有效利用 CSV 文件。 3. **正则表达式**:理解正则表达式的基本概念及其应用,掌握通配符、重复限定符和转义字符等基本知识,探索高级正则表达式及应用实例。 4. **管理数据与进程**:学习如何基于用户交互读取和写入数据文件,深入了解标准流、环境变量和命令行参数,掌握 Python 子进程的使用方法和日志文件的处理。 5. **Python 中的测试**:学习如何创建 Python 测试,手动测试与自动化测试的区别,以及如何编写单元测试和处理错误与异常。 6. **Bash 脚本**:了解 Linux 操作系统的基本命令,学习 Bash 脚本的创建,变量和通配符的使用,以及何时使用 Bash 代替 Python 的高级概念。 7. **期末项目**:在此模块中,您将应用所学知识,完成一个具有挑战性的最终项目:编写一个脚本扫描日志文件中的特定错误,进行问题陈述、研究解决方案并编写实现代码。 这个课程为学习使用 Python 进行操作系统交互提供了坚实的基础,适合希望在 IT 和自动化领域发展的学习者。

课程大纲

Name:Getting Your Python On

Description: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.

Name:Managing Files with Python

Description: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. You’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.

Name:Regular Expressions

Description: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 study guide to serve as your go-to guide for regular expressions.

Name:Managing Data and Processes

Description:In this module, you’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.

Name:Testing in Python

Description: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.

Name:Bash Scripting

Description: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.

Name:Final Project

Description: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!

课程评论(0条)

课程详情

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. 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.

课程标签

0人关注该课程

主题相关的课程