import sys  sys.exit()

Read more of this post