I want to use something like this:
print('Hello')
with dont_print():
print('some other text')
print('more text')
print('World')
The output should be:
Hello
World
So everything inside the dont_print
won't get printed.
How can I get a function like this?