2023-05-23 19:06:25 +02:00
|
|
|
IO model
|
|
|
|
========
|
|
|
|
|
|
|
|
Python is supposed to interact with outside world (i.e. everything
|
|
|
|
outside the interpretor) through numerous ways:
|
|
|
|
|
|
|
|
- ``open`` and ``input`` builtin functions.
|
|
|
|
- ``os`` module (e.g. ``os.open`` function)
|
|
|
|
- ``stdout``, ``stderr`` and ``stdin`` files descriptors
|
|
|
|
- ``__import__`` & co
|
|
|
|
- ``ctypes`` & micropython's ``ffi`` libraries
|
|
|
|
- ...
|
|
|
|
|
|
|
|
However those functions are no longer relevant when python is embedded
|
2023-06-02 11:31:19 +02:00
|
|
|
into Pandemonium. They can even be dangerous when opening a Pandemonium application to
|
2023-05-23 19:06:25 +02:00
|
|
|
modding given a 3rd party python code has suddently full access to the computer !
|
|
|
|
|
2023-06-02 11:31:19 +02:00
|
|
|
Hence, those functions needs to be adapted to Pandemonium:
|
2023-05-23 19:06:25 +02:00
|
|
|
- ``ctype``, ``ffi`` and ``open`` disabled
|
2023-06-02 11:31:19 +02:00
|
|
|
- ``stdout``, ``stderr`` and ``stdin`` redirected to Pandemonium editor's console
|