Exit in Spaceclaim Script
Trying to exit from a spaceclaim script using sys.exit(), but that does not work (say sample code below gives an error on last line). Does anyone know why and how one can exit a code in spaceclaim.
# Python Script, API Version = V232 import sys for i in range(10): print(i) if i == 5: print('hi') sys.exit()
Comments
-
Do you mean stop the code processing or close the SC application?
0 -
Hi
So stopping and exiting the python script as described by the sys.exit() definition below - which does not work in SC scripting as mentioned. So we want to stop and exit the SC script, but ofcourse if you try my example in SC script that does not really work.
'Python's exit function, sys. exit() , is a built-in method used to terminate a Python script. It raises the SystemExit exception which, if not caught, causes the Python interpreter to quit. It's commonly used to manage the termination of Python programs'
0