Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Python voor beheerautomatisering

Python voor het dagelijkse werk van een beheerder: bestanden en mappen, regex, CSV, JSON en YAML, systeemcommando's, API's, logging, commandoregeltools en planningen.

Cursus van
Python Software Foundation
Cursuscode
Python
Versie
Python 3.12
Lessen
48

Deze samenvattingen volgen de openbare inhoud van de cursus. Ik schreef elke les in mijn eigen woorden en testte de commando's op RHEL 10. Het is geen lesmateriaal van Red Hat. Volg de officiële cursus voor de volledige inhoud en de praktijklabs.

Volgende cursus: MLOps

Delen en hoofdstukken

Deel 1

Basis van de taal

  1. 1Write your first Python scriptsPython basics6 lessen
    Lessen
    1. 1.1 Run Python
    2. 1.2 Isolate packages with a virtual environment
    3. 1.3 Use values and variables
    4. 1.4 Decide with if
    5. 1.5 Repeat with for and while
    6. 1.6 Write functions
  2. 2Work with lists, dictionaries and stringsData structures6 lessen
    Lessen
    1. 2.1 Use lists
    2. 2.2 Use dictionaries
    3. 2.3 Use sets and tuples
    4. 2.4 Handle strings
    5. 2.5 Write comprehensions
    6. 2.6 Count and group with collections

Deel 2

Met het systeem werken

  1. 3Read, write and organise files and foldersFiles and folders5 lessen
    Lessen
    1. 3.1 Work with paths
    2. 3.2 Read and write text files
    3. 3.3 Copy, move and delete
    4. 3.4 Clean up old files
    5. 3.5 Make archives
  2. 4Find and extract text with regular expressionsPattern matching with regular expressions4 lessen
    Lessen
    1. 4.1 Search and match
    2. 4.2 Find all matches
    3. 4.3 Use named groups
    4. 4.4 Replace and split
  3. 5Read and write CSV, JSON and YAMLData formats4 lessen
    Lessen
    1. 5.1 Read and write CSV
    2. 5.2 Read and write JSON
    3. 5.3 Read and write YAML
    4. 5.4 Use TOML and INI
  4. 6Run commands and read the systemSystem administration with Python5 lessen
    Lessen
    1. 6.1 Run commands with subprocess
    2. 6.2 Read environment and arguments
    3. 6.3 Check disks, memory and processes
    4. 6.4 Check the network
    5. 6.5 Return exit codes

Deel 3

Echte tools

  1. 7Talk to web APIsWeb requests and REST APIs5 lessen
    Lessen
    1. 7.1 Make GET requests
    2. 7.2 Send data and use tokens
    3. 7.3 Handle pages
    4. 7.4 Retry on errors
    5. 7.5 Check many websites
  2. 8Handle errors and write logsExceptions and logging5 lessen
    Lessen
    1. 8.1 Catch exceptions
    2. 8.2 Raise your own errors
    3. 8.3 Write logs with logging
    4. 8.4 Log to the journal
    5. 8.5 Rotate log files
  3. 9Build command-line tools and schedule themCommand-line tools and scheduling4 lessen
    Lessen
    1. 9.1 Parse arguments with argparse
    2. 9.2 Install the tool for everyone
    3. 9.3 Schedule it with a systemd timer
    4. 9.4 Test your code
  4. 10Build a daily server reportHands-on project4 lessen
    Lessen
    1. 10.1 Plan the report
    2. 10.2 Write the main script
    3. 10.3 Run it every morning
    4. 10.4 Publish it