You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to do some extra work after the command handler, however, the program exits after main, like the following:
importclick@click.command()defmain():
passif__name__=='__main__':
main() # program exited here! print('do something')
My current solution is to catch SystemExit, but that makes my code ugly and less readable, and I'm wondering if there's some configuration that keeps the click from exiting after the command handler
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to do some extra work after the command handler, however, the program exits after main, like the following:
My current solution is to catch
SystemExit
, but that makes my code ugly and less readable, and I'm wondering if there's some configuration that keeps the click from exiting after the command handlerBeta Was this translation helpful? Give feedback.
All reactions