I am new in Python and I did not find a clear method yet.
I have several functions (possibly hundreds) that I want to wrap in the same code over and over.
try:
OneOfTheOneHundredFunctions()
except MY_ERROR as error:
print('Error: I caught an error')
Do I have to specify the wrapper for each of the OneOfTheOneHundredFunctions()
?
In C++, I would do that with a macro
, is there something similar in python?