2014-10-31 22:21:37 +00:00
|
|
|
:mod:`sys` -- system specific functions
|
|
|
|
=======================================
|
2014-10-31 01:37:19 +00:00
|
|
|
|
|
|
|
.. module:: sys
|
|
|
|
:synopsis: system specific functions
|
|
|
|
|
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
|
|
|
.. function:: exit([retval])
|
|
|
|
|
|
|
|
Raise a ``SystemExit`` exception. If an argument is given, it is the
|
|
|
|
value given to ``SystemExit``.
|
|
|
|
|
2014-12-06 22:18:37 +00:00
|
|
|
.. function:: print_exception(exc, [file])
|
|
|
|
|
|
|
|
Print exception with a traceback to a file-like object ``file`` (or
|
|
|
|
``sys.stdout`` by default).
|
|
|
|
|
2014-12-19 22:10:38 +00:00
|
|
|
.. admonition:: Difference to CPython
|
2014-12-22 13:42:30 +00:00
|
|
|
:class: attention
|
2014-12-19 22:10:38 +00:00
|
|
|
|
|
|
|
This function appears in the ``traceback`` module in CPython.
|
|
|
|
|
2014-10-31 01:37:19 +00:00
|
|
|
Constants
|
|
|
|
---------
|
|
|
|
|
|
|
|
.. data:: argv
|
|
|
|
|
|
|
|
a mutable list of arguments this program started with
|
|
|
|
|
|
|
|
.. data:: byteorder
|
|
|
|
|
|
|
|
the byte order of the system ("little" or "big")
|
|
|
|
|
|
|
|
.. data:: path
|
|
|
|
|
|
|
|
a mutable list of directories to search for imported modules
|
|
|
|
|
|
|
|
.. data:: platform
|
|
|
|
|
2014-12-19 22:10:38 +00:00
|
|
|
The platform that Micro Python 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.
|
2014-10-31 01:37:19 +00:00
|
|
|
|
|
|
|
.. data:: stderr
|
|
|
|
|
|
|
|
standard error (connected to USB VCP, and optional UART object)
|
|
|
|
|
|
|
|
.. data:: stdin
|
|
|
|
|
|
|
|
standard input (connected to USB VCP, and optional UART object)
|
|
|
|
|
|
|
|
.. data:: stdout
|
|
|
|
|
|
|
|
standard output (connected to USB VCP, and optional UART object)
|
|
|
|
|
|
|
|
.. data:: version
|
|
|
|
|
|
|
|
Python language version that this implementation conforms to, as a string
|
|
|
|
|
|
|
|
.. data:: version_info
|
|
|
|
|
|
|
|
Python language version that this implementation conforms to, as a tuple of ints
|