micropython icon indicating copy to clipboard operation
micropython copied to clipboard

Is there any way to call a library like any other development environment?

Open hnwangkg-ezio opened this issue 6 years ago • 4 comments

Is there any way to call a library like any other development environment?

from microbit import * import GUI

I want to add a library of import GUI as above. I haven't worked hard for a long time and I didn't find a suitable method. The editor I use is Mu. If so, then my project will be very clean.

hnwangkg-ezio avatar Mar 21 '18 02:03 hnwangkg-ezio

You can upload python modules to the micro:bit using Mu's "files" tab. Then you can import them.

deshipu avatar Mar 21 '18 06:03 deshipu

The procedure is not exactly intuitive. Here is a guide on how to do this: https://microbit-playground.co.uk/howto/add-python-module-microbit-micropython

I find it easier to just copy the code I wish to import to the top of my file if the import is fairly simple.

MrYsLab avatar Mar 21 '18 19:03 MrYsLab

Thanks...

hnwangkg-ezio avatar Mar 22 '18 03:03 hnwangkg-ezio

you may find the command ufs (microfs) an easier to use command line option. install it on debian linux with the following sudo -H pip3 install microfs . You then just type ufs put GUI.py

rhubarbdog avatar May 10 '18 22:05 rhubarbdog