I have the following program statement (program1.py)
I have a program 1:
try:
except:
I have another program 2 (program2.py):
def something:
print hello
is there a way when program 1 is imported into program 2 , that program 1 wraps around program 2, so the program should be
try:
def something:
print hello # all program 2 components
except:
I am confused on how to do this and any pointers would be appreciated
The way I would suggest going about this is with a decorator:
OUTPUT
Your logic might need to be reworked, but I think it would be worth it in the end.