# Stop a script with code? [duplicate]

Sometimes I have a big script and I want to do some tests without it running until the end. I'd like to add a lign of code to terminate the script where I want it without closing blender.

I've found this code online but it quit Blender, which is not what I want, I'd like the equivalent of a CTRL+C in the console.

import sys
sys.exit()


raise Exception(“I’ve just triggered termination of my script”)