First page Back Continue Last page Overview Image

Kontext-Manager

from contextlib import contextmanager

@contextmanager

def func():

print("With statement has started")

yield # the block after with is executed

print("With statement ends now")

with func():

print("Whatever has to be done will be done!")