To terminate or stop a Python script, use:
1.
import
sys
2.
3.
sys.exit()
[ Source ]
Mainly notes to future-Twig (and for anyone else who may find them useful)
If you've found one or more of my blog posts helpful, why not say thanks by buying me a coffee or beer?