python - Correct way to gracefully exit code prematurely from any section -


i have bunch of threads, classes, methods, , loops. in each level have pass, check, , handle global variable causes section of code exit before completing it's task if user wants exit program early.

every time-dependent section literally wrapped in if not quit_now(): (or similar). cannot code-fu - there better way?


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -