2020-03-20 01:33:11 +00:00
|
|
|
Unix-specific libraries
|
|
|
|
=======================
|
|
|
|
|
2022-08-10 14:38:03 +00:00
|
|
|
These are libraries that will only run on the Unix port of MicroPython, or are
|
|
|
|
too big to be used on microcontrollers. There is some limited support for the
|
|
|
|
Windows port too.
|
2020-03-20 01:33:11 +00:00
|
|
|
|
2022-08-10 14:38:03 +00:00
|
|
|
**Note:** This directory is unmaintained.
|
2020-03-20 01:33:11 +00:00
|
|
|
|
|
|
|
Background
|
|
|
|
----------
|
|
|
|
|
|
|
|
The libraries in this directory provide additional CPython compatibility using
|
|
|
|
the host operating system's native libraries.
|
|
|
|
|
2022-08-10 14:38:03 +00:00
|
|
|
This is implemented either by accessing the libraries directly via libffi, or
|
|
|
|
by using built-in modules that are only available on the Unix port.
|
2020-03-20 01:33:11 +00:00
|
|
|
|
|
|
|
In theory, this allows you to use MicroPython as a more complete drop-in
|
|
|
|
replacement for CPython.
|
2022-08-10 14:38:03 +00:00
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
To use a unix-specific library, pass `unix_ffi=True` to `require()` in your
|
|
|
|
manifest file.
|
|
|
|
|
|
|
|
```py
|
|
|
|
require("os", unix_ffi=True) # Use the unix-ffi version instead of python-stdlib.
|
|
|
|
```
|