How to add my own python module to micropython hex file?

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
jarda
Posts: 3
Joined: Sun Sep 04, 2016 10:13 pm

How to add my own python module to micropython hex file?

Post by jarda » Tue Jan 08, 2019 1:07 am

I know how to build micropython for microbit and how to add my own python program to it. It is executed if there is not main.py in microbit flash storage. I know that there exists a way how to add C module which could be used with python program. But is there a way how to add precompiled python module which could be imported later with another python program?

jickster
Posts: 606
Joined: Thu Sep 07, 2017 8:57 pm

Re: How to add my own python module to micropython hex file?

Post by jickster » Wed Jan 09, 2019 6:42 pm

When you say precompiled do you mean
.c -> .obj (compile c-code to binary)
or
.py -> .mpy (compile python source to byte-code)

?


Sent from my iPhone using Tapatalk Pro

Post Reply