Get Started Using Python Context Managers and the `with` Statement

Publié le: 15 décembre 2022
sur la chaîne: Real Python
3,117
121

What’s a context manager? It’s a block of code that has side effects upon entering and exiting. The with statement in Python is a quite useful tool for properly managing external resources in your programs. It handles the setup and teardown phases whenever you’re dealing with external resources or with operations that require those phases.

This is a portion of the complete course, which you can find here:
https://realpython.com/courses/with-s...

The rest of the course covers how to:
- Precision and Threading Locks
- Creating Your Own Context Manager
- Practice by Redirecting Stdout and Creating a File Writer


Sur cette page du site, vous pouvez voir la vidéo en ligne Get Started Using Python Context Managers and the `with` Statement durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Real Python 15 décembre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,117 fois et il a aimé 121 téléspectateurs. Bon visionnage!