Nov. 6, 2023, 2:34 p.m. | Python and Pandas with Reuven Lerner

Reuven Lerner www.youtube.com

Why do we use "with" when opening files? Because "with" invokes the context manager protocol, ensuring that the file is flushed and closed at the end of the block. In this video, I explain what that means, and then show you how the protocol works, and how we can add it to our own classes.

context files manager managers protocol python show understanding video

AI Research Scientist

@ Vara | Berlin, Germany and Remote

Data Architect

@ University of Texas at Austin | Austin, TX

Data ETL Engineer

@ University of Texas at Austin | Austin, TX

Lead GNSS Data Scientist

@ Lurra Systems | Melbourne

Senior Data Engineer (m/f/d)

@ Project A Ventures | Berlin, Germany

Principle Research Scientist

@ Analog Devices | US, MA, Boston