Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
de30bf01
Verified
Commit
de30bf01
authored
Aug 19, 2019
by
Rahix
Browse files
docs(pycardium): Document os module
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
af4587a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Documentation/index.rst
View file @
de30bf01
...
...
@@ -26,6 +26,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/display
pycardium/leds
pycardium/light-sensor
pycardium/os
pycardium/utime
pycardium/vibra
...
...
Documentation/pycardium/os.rst
0 → 100644
View file @
de30bf01
.. py:module:: os
``os`` - OS Functions
=====================
The ``os`` module allows access to a few core functionalities of Epicardium and functions found in CPythons ``os`` module.
CPython-Like
------------
.. py:function:: os.unlink(path)
Unlink (remove) a file.
:param str path: The file to remove.
.. py:function:: os.listdir(dir)
List contents of a directory.
:param str dir: Path to the directory to list.
:returns: A list of entities (files or subdirectories) in the directory
``dir``.
Epicardium-Specific
-------------------
.. py:function:: os.exit(ret = None)
Exit from the current app and return to the menu.
:param int ret: Optional return code, same semantics as Posix (``0`` means
success).
:return: This function will never return.
.. py:function:: os.exec(name)
Try executing a new app, stopping the currently running one.
``name`` is the path to either a l0dable (ending in ``.elf``) or a python
script (ending in ``.py``). If the path does not lead to an executable file,
``os.exec()`` will raise an exception.
:param str name: Path to new app/script/l0dable.
:return: This function never returns. It can, however raise an exception.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment