python close to code example Example 1: how to code python to close a program import sys sys.exit(0) Example 2: create close python program in puthon import os os._exit(0)