↧
Answer by klewis for Python decorator runs during import before function is...
@Nickolay 's comment got me to the desired behavior:If I want something to execute only when the decorated function is invoked the code needs to be placed within the wrapper.So the solution is:def...
View ArticlePython decorator runs during import before function is called
I'm trying to use a decorator check_wake_server to check if a remote host is available before before executing a host_function that interacts with that host. The issue I'm hitting is that the decorator...
View Article