Python contextlib (Working with files - open, read, write, copy, binary)
Working with files using context manager: Example to get the list of files in the directory with context manager: Working with files (open, read, write, copy, binary) contextlib