Back to Browse

What does this package do? - Episode 5: Contextlib

4.7K views
Premiered Oct 7, 2020
8:20

Context Managers help you make code easier to read while making sure that all your resources are cleaned up properly. In this video, we dive into contextlib, that providers some amazing tools to create context managers, as well as providing some very useful context managers right out of the box. 00:00 Introduction 00:12 What context managers do 00:37 The contextmanager decorator 02:08 Using classes to create context managers 03:11 Using ContextDecorator 03:51 Using the ExitStack to open files simultaneously 04:39 Using suppress to suppress Exceptions 05:17 Using ExitStack with conditions 07:32 Redirecting console output with redirect_stdout Links: - Download PyCharm: https://jb.gg/u8syo9

Download

1 formats

Video Formats

360pmp413.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

What does this package do? - Episode 5: Contextlib | NatokHD