run code when closeing program python code example
Example 1: how to code python to close a program
import sys
sys.exit(0)
Example 2: exit in python
import sys
msg = "bye bye"
sys.exit(msg)
# you can use it with out a msg
import sys
sys.exit(0)
import sys
msg = "bye bye"
sys.exit(msg)
# you can use it with out a msg