Break/Ctrl-C out of python script

(Vincent Shen) #1

I am running a huge calculation through python script. Is there a way to force break out of the script other than to force close Rhino?




To make Rhino respond to ESC key during a tight loop, add a scriptcontext.escape_test to the first line of the loop:

import scriptcontext

def DoSomething():
    for i in xrange(10000):
        if scriptcontext.escape_test(False): return
        print i


(Vincent Shen) #3

Great! Thank you!