The sys module provides access to functions and values concerning the program’s runtime environment, such as the command line parameters in sys.argv
or the function sys.exit()
to end the current process from any point in the program flow.
While cleanly separated into a module, it’s actually built-in and as such will always be available under normal circumstances.
import sys
from sys import exit
For details on all sys module members, refer to the official documentation.