Module ?
Opened this issue · 6 comments
Hello,
I have recently tried to integrate some modules with my script but none of them work for example
import time;
import utime;
I'm using it on TI NSPIRE CX CAS :
https://tiplanet.org/forum/archives_voir.php?id=313881
I would like to use time.sleep(6)
Some parts of time
are implemented in unix/modtime.c
, those could probably be ported over. Maybe one of the active forks of this project did that already?
@parisseb 's micropython build is much more recent and has several modules already built in, so I guess this would also be simpler?
There is a nsp module in my micropy Nspire port (micropy is included inside the KhiCAS shell), with code from the historical micropython port. I also aliased time to the nsp module (import time is the same as import nsp). But it's probably not the same as time or utime.
micropy has original implementation for maths modules (like arit for arithmetic or linalg for linear algebra) and graphic modules (turtle, graphic).
micropy list of modules:
#define MICROPY_PORT_BUILTIN_MODULES \ { MP_OBJ_NEW_QSTR(MP_QSTR__os), (mp_obj_t) &mp_module_os }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_nsp), (mp_obj_t) &mp_module_nsp }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t) &mp_module_nsp }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_cas), (mp_obj_t) &mp_module_cas }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_xcas), (mp_obj_t) &mp_module_cas }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_arit), (mp_obj_t) &mp_module_arit }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_linalg), (mp_obj_t) &mp_module_linalg }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_matplotl), (mp_obj_t) &mp_module_matplotl }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_matplotlib), (mp_obj_t) &mp_module_matplotl }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_matplotlib_dot_pyplot), (mp_obj_t) &mp_module_matplotl }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_pylab), (mp_obj_t) &mp_module_matplotl }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_turtle), (mp_obj_t) &mp_module_turtle }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_casioplot), (mp_obj_t) &mp_module_graphic }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_kandinsky), (mp_obj_t) &mp_module_graphic }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_graphic), (mp_obj_t) &mp_module_graphic },\ { MP_ROM_QSTR(MP_QSTR_ulab), (mp_obj_t) &ulab_user_cmodule },
nsp module content:
STATIC const mp_map_elem_t mp_module_nsp_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_nsp) }, { MP_OBJ_NEW_QSTR(MP_QSTR_Texture), (mp_obj_t) &nsp_texture_type }, { MP_OBJ_NEW_QSTR(MP_QSTR_waitKeypress), (mp_obj_t) &nsp_waitKeypress_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_readRTC), (mp_obj_t) &nsp_readRTC_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_monotonic), (mp_obj_t) &nsp_readRTC_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t) &nsp_readRTC_obj }, };
Do you have a list of available modules, for the moment I know that there is "math" that's all.