Noob question on Modules
Posted: Sun Feb 05, 2017 7:14 pm
Hi All,
I have a question on using Micropython modules sourced from PyPI.
I have several esp8266 (Wemos D1 mini) boards which I have flashed with the Micropython firmware and have been using to improve my Python ability.
However, I have a question on using Micropython modules from Pypi, such as the https://pypi.python.org/pypi/micropytho ... mple/1.3.2 module. On a normal Python dev system, such as a Raspberry Pi, I'd just use virtualenv or pip install micropython-umqtt.simple and then use an import.
This obviously doesn't work on these boards, so I'm looking for some guidance on using these modules.
I believe that I could simply copy the .py files to the root filesystem of the board, but I'm just wondering on the above module as it actually is a umqtt directory with simple.py in it. Would I recreate that on the board filesystem, and if so, how would I import the module?
I was under the impression that the .py file name would have to match the module name so in this case would I import simple?
I know we have plenty of space for storing the modules on the board, my questions revolve mostly about getting them on the board and then calling them in my code in the most efficient manner.
Thanks for any help you can give me.
Stef
I have a question on using Micropython modules sourced from PyPI.
I have several esp8266 (Wemos D1 mini) boards which I have flashed with the Micropython firmware and have been using to improve my Python ability.
However, I have a question on using Micropython modules from Pypi, such as the https://pypi.python.org/pypi/micropytho ... mple/1.3.2 module. On a normal Python dev system, such as a Raspberry Pi, I'd just use virtualenv or pip install micropython-umqtt.simple and then use an import.
This obviously doesn't work on these boards, so I'm looking for some guidance on using these modules.
I believe that I could simply copy the .py files to the root filesystem of the board, but I'm just wondering on the above module as it actually is a umqtt directory with simple.py in it. Would I recreate that on the board filesystem, and if so, how would I import the module?
I was under the impression that the .py file name would have to match the module name so in this case would I import simple?
I know we have plenty of space for storing the modules on the board, my questions revolve mostly about getting them on the board and then calling them in my code in the most efficient manner.
Thanks for any help you can give me.
Stef