Use external libraries

  • Where can I find documentation for using/importing other libraries on my LoPy.
    I want to use the Paho MQTT Python library. Should I put it somewhere in the /flash over ftp?

    I'm new to Pycom and the Python programming language but I'm an experienced developer in Java, C++, Arduino,... So if you can point me to any other valuable info to get me started please share!

    Thx in advance!

  • Note that /flash and /flash/lib are in sys.path by default. If you want to put your libraries somewhere else, don't for get to add that directory to your path in

    import sys

  • I think that /flash/lib folder is also right and logical place for external libraries. ;o)

  • Library is just another python file. If you put into the same folder as the you can than import it in the file like this:

    import library

    and use objects in the library:


    python docs

Log in to reply

Pycom on Twitter