Python stub file #178
kdschlosser
started this conversation in
General
Replies: 1 comment
-
Thanks, this sounds good. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I do not believe I have ever mentioned this and this will save a lot of people quite a bit of hair pulling.
When you compile the firmware there is a stub file that gets created. This stub file is the LVGL API in MicroPython. It doesn't include anything for the drivers which is something I do plan on adding at some point in time. At least the LVGL API is stubed out for easier development.
The file that gets created when compiling gets placed into the root of the project folder. The filename is "lvgl.pyi". After you have compiled the firmware if you make a copy of this file and place it into the root of whatever project you are working on and you are using an IDE like VSCode, Visual Studio or PyCharm the stub file will get automatically loaded. This will provide you with code completion and type checking in the IDE. It provides the complete set of Intellisense features.
So remember to copy that stub file into your projects root folder if you want to make writing GUI code for MicroPython a whole lot easier to do.
I am also thinking about providing stub files for machine, micropython and other various MicroPython specific libraries as well. I have these already made I would just need to add them to lvgl_micropython so they would be available to the users.
Beta Was this translation helpful? Give feedback.
All reactions