kill python script within python script code example Example: python kill script import sys sys.exit()