stop the whole python script code example
Example 1: how to stop the program in python
import sys
sys.exit()
Example 2: python stop script
some code
quit() # quit at this point
some more code (that's not executed)
import sys
sys.exit()
some code
quit() # quit at this point
some more code (that's not executed)