sys
– system specific functions¶
Functions¶
-
sys.
exit
([retval])¶ Raise a
SystemExit
exception. If an argument is given, it is the value given toSystemExit
.
-
sys.
print_exception
(exc[, file])¶ Print exception with a traceback to a file-like object
file
(orsys.stdout
by default).Difference to CPython
This function appears in the
traceback
module in CPython.
Constants¶
-
sys.
argv
¶ a mutable list of arguments this program started with
-
sys.
byteorder
¶ the byte order of the system (“little” or “big”)
-
sys.
path
¶ a mutable list of directories to search for imported modules
-
sys.
platform
¶ The platform that MicroPython is running on. This is “pyboard” on the pyboard and provides a robust way of determining if a script is running on the pyboard or not.
-
sys.
stderr
¶ standard error (connected to USB VCP, and optional UART object)
-
sys.
stdin
¶ standard input (connected to USB VCP, and optional UART object)
-
sys.
stdout
¶ standard output (connected to USB VCP, and optional UART object)
-
sys.
version
¶ Python language version that this implementation conforms to, as a string
-
sys.
version_info
¶ Python language version that this implementation conforms to, as a tuple of ints