Loading Github library to Thonny

I am trying to use Mark Gadding’s “packed-font” on the Piicodev OLED display. How do I load his GitHub library to Thonny?

1 Like

Hi @John478,

Looks like a cool library. The packed-font code should directly work with the Piicodev OLED display.

Here are the steps to import this library for use in Thonny:

  1. Download the library from GitHub: You can do this by navigating to the repository on GitHub (linked below), then click the ‘Code’ button, and then the ‘Download ZIP’ option. This will download a .zip file of the repository onto your computer.
    image

  2. Find the downloaded .zip file in your computer’s filesystem, and extract it.

  3. Open up Thonny and click on ‘Run’ from the menu at the top, then click on ‘Select interpreter’.

  4. In the ‘Select interpreter’ dialogue box that opens, click the ‘…’ button next to the ‘Interpreter’ drop-down menu. This will open a file explorer window. Navigate to the location where you extracted the downloaded library and confirm you want to import that library.

  5. Now you should be able to import the package in your Python file by using the import statement.

I would suggest running the PiicoDev_SSD1306.py example file in that library as a good place to start.

Hope this helps! :grinning:

1 Like

Hi Samuel,

Thanks for getting back to me so fast.
Interestingly, when I am using the MicroPython (Raspberry Pi Pico) Interpreter in Thonny, there is no “…” shown as you can see in the screenshot so I can’t upload the unzipped files.

I’m not sure I agree with @Samuel’s instructions - it might not work with the particular structure Mark has used, though i haven’t tested that method.

I would and upload the packed-font files to your pico’s root directory. Just like how the files are normally uploaded in the guide.

For flexibility, you may just want to upload the entire contents of the display and fonts directories. Not the entire zipped folder structure.

You’ll note that there are PiicoDev_Unified.py and PiicoDev_SSD1306.py files that will replace the ones you would usually use from the guide.

2 Likes