Python lessons from scratch / #15 – “With...as” manager for working with files

Опубликовано: 16 Апрель 2026
на канале: Школа програмування
12,210
596

When working with files, you often need to track exceptions. Doing this only with try – except is not very convenient. For this reason, Python has a "with...as" manager. In this lesson, we will learn how to use this manager in practice.

✅ Useful links:
– Lesson on the itProger website: https://itproger.com/ua/course/python/15

⏰ Time codes:
00:00 - Start
00:18 - Reading data from a file
01:48 - Exception handler
02:47 - Closing a file
04:46 - With...as manager
07:05 - Final part

✔ Programming school: https://itproger.com

✔ -------------
🔥 Telegram: https://t.me/+12cHirBfJ8xmMDUy
Instagram:   / itproger.code  
Twitter:   / goshadudar  

#lessons #programming