Context is an opening file, catching expressions, etc. A context manager is anything that manages your context. You can use it like this:
from contextlib import contextmanager
def my_open(filename):
file = open(filename)
try:
# this yield is where the body of the with statement happens
yield file
finally:
file.close()