[Swlug] smbus on Pi Pico

Ivan Wright quidsup at gmail.com
Sun Apr 24 18:31:21 UTC 2022


I'm not familiar with using .so files in Python. If I was to import a file
called foo.py which contained a class called bar and located in the
subfolder lib the import line is:
from lib.foo import *

Using it in the parent file would be:
myval = lib.foo.bar()

Ivan

On Sun, 24 Apr 2022, 18:59 Rhys Sage via Swlug, <swlug at mailman.lug.org.uk>
wrote:

> I'm not quite sure how to import smbus in Python. Via Thonny I imported
> the circuitpython version to the Pi Pico. It's sitting in a subdirectory
> called "lib" in the program folder.
>
> I've been playing with various different ideas and drawing a blank so far.
> This is the best I have come up with.
>
> #import sys
> #sys.path.append("lib/")
> import lib/smbus.cpython-39-x86_64-linux-gnu.so
>
> I'm trying to get the BMP280 pressure/humidity module to work.
>
> Rhys Sage
>
> --
> Swlug mailing list
> Swlug at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/swlug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/swlug/attachments/20220424/01f36d84/attachment.htm>


More information about the Swlug mailing list