On this page
exit
Prev: exec | Up: __builtins__ | Next: filter
Rel: True, False, None, Ellipsis, NotImplemented
Ref: docs.python.org — exit
Tags: #public #python3 #builtins
Import & Availability
# Built-in (available globally without import)
from builtins import exit
Overview & Signature
exit(code=None)
Python built-in exit.
Usage
assert callable(exit)
Gotchas
- Interactive REPL helper only: Always use
sys.exit(code)in scripts and packages (works even underpython3 -S).
REPL Inspect
help(exit)
Linked from
Related notes
- tuts/python3/__builtins__/__builtins__ Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/exec Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/filter Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__ links to this page; shared tags: #builtins
- tuts/python3/__builtins__/Ellipsis Linked here; shared tags: #builtins
- tuts/python3/__builtins__/False Linked here; shared tags: #builtins
- tuts/python3/__builtins__/None Linked here; shared tags: #builtins
- tuts/python3/__builtins__/NotImplemented Linked here; shared tags: #builtins
- tuts/python3/__builtins__/True Linked here; shared tags: #builtins
- tuts/c/builtins shared tags: #builtins