The user is entering a python script in a Java GUI python-editor and can run it from the editor. Is there a way to take the user's script and impose a time limit on the total script?
I'm familiar with how to this with functions / signal.alarm(but I'm on windows & unix Jython) but the only solution I have come up with is to put that script in a method in another script where I use the setTrace() function but that removes the "feature" that the value of global variables in it persist. ie.
try:
i+=1
except NameError:
i=0
The value of 'i' increments by 1 with every execution.