If your code is written in a GHPython node, is there a way to exit from the code in the middle of the code?
You can exist from a function by “return”.
You can exit from a for loop by “break”
Buf when your code is at the top level, how to exit?
You can also do it if you use the exit() function in your code. More ideally, you can do sys.exit() . sys.exit() which might terminate Python even if you are running things in parallel through the multiprocessing package.
Note: In order to use the sys.exit() , you must import it: import sys