Programmatically stop execution of python script?
You could raise SystemExit(0)
instead of going to all the trouble to import sys; sys.exit(0)
.
sys.exit() will do exactly what you want.
import sys
sys.exit("Error message")
You could raise SystemExit(0)
instead of going to all the trouble to import sys; sys.exit(0)
.
sys.exit() will do exactly what you want.
import sys
sys.exit("Error message")