micropython/docs/library/sys.rst

71 wiersze
1.5 KiB
ReStructuredText
Czysty Zwykły widok Historia

2014-10-31 22:21:37 +00:00
:mod:`sys` -- system specific functions
=======================================
.. module:: sys
:synopsis: system specific functions
Functions
---------
.. function:: exit(retval=0)
Terminate current program with a given exit code. Underlyingly, this
function raise as ``SystemExit`` exception. If an argument is given, its
value given as an argument to ``SystemExit``.
.. function:: print_exception(exc, file=sys.stdout)
2014-12-06 22:18:37 +00:00
Print exception with a traceback to a file-like object `file` (or
2014-12-06 22:18:37 +00:00
``sys.stdout`` by default).
.. admonition:: Difference to CPython
:class: attention
This function appears in the ``traceback`` module in CPython.
Constants
---------
.. data:: argv
A mutable list of arguments the current program was started with.
.. data:: byteorder
The byte order of the system ("little" or "big").
2016-05-01 10:32:15 +00:00
.. data:: modules
Dictionary of loaded modules. On some ports, it may not include builtin
modules.
.. data:: path
A mutable list of directories to search for imported modules.
.. data:: 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.
.. data:: stderr
Standard error stream.
.. data:: stdin
Standard input stream.
.. data:: stdout
Standard output stream.
.. 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.