On this page
sys.displayhook
Prev: sys.deactivate_stack_trampoline | Up: sys | Next: sys.exc_info
Rel: sys.activate_stack_trampoline, sys.addaudithook, sys.audit, sys.breakpointhook
Ref: docs.python.org — sys.displayhook
Tags: #public #python3 #stdlib #sys
Import
import sys
from sys import displayhook
Signature & Overview
sys.displayhook(object, /)
Print an object to sys.stdout and also save it in builtins._
Usage
import sys
# Controls how interactive REPL expressions are printed and bound to builtins._
assert callable(sys.displayhook)
Gotchas
- Interactive REPL only:
sys.displayhook(None)prints nothing; override it to customize REPL output (e.g., auto-pretty-printing).
REPL Inspect
from sys import displayhook
help(displayhook)
Linked from
Related notes
- tuts/python3/stdlib_module/sys/deactivate_stack_trampoline Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/exc_info Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sys/activate_stack_trampoline Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/addaudithook Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/audit Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/breakpointhook Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/call_tracing shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/excepthook shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/exception shared tags: #stdlib, #sys