Sometimes in Python programs you need to acquire external resources, like file handles, and then free them again. Python's context manager construction lets you automatically free things up when you're done with them, and in a way that lets you see at a glance the scope of what's used and when.
Follow TECH(talk) for the latest tech news and discussion!
--------------------------------
SUBSCRIBE: http://www.youtube.com/subscription_c...
FACEBOOK: / idgtechtalk
TWITTER: / idgtechtalk
IDG ENTERPRISE WEBSITES
Computerworld: https://www.computerworld.com/video/s...
CIO: https://www.cio.com/video/series/8534...
CSO: https://www.csoonline.com/video/serie...
InfoWorld: https://www.infoworld.com/video/serie...
Network World: https://www.networkworld.com/video/se...