Question concerning Python decorators
In the SL-Python-course there is the example: # begin of code def decor(func): def wrap(): print("============") func() print("============") return wrap @decor def print_text(): print("Hello world!") print_text() # end of code I do not understand, how I would have to change the code to print common strings in the function print_text(). I changed the code into: # begin of code def decor(func,x): def wrap(x): print("============") func(x) print("============") return wrap(x) @decor def print_text(x): print(x) print_text("Hello world!") # end of code This produces errors. Could somebody please correct the second code that I can see how to enter variables in decorators.