- Introduction
- Thonny How to Guides:
- How to download Thonny IDE?
- How to set the MicroPython interpreter in Thonny IDE?
- How to connect/re-connect with your MicroPython device in Thonny IDE?
- How to interrupt running MicroPython script in Thonny IDE?
- Thonny IDE: The device is busy or does not respond
- How to install MicroPython libraries or packages in Thonny IDE?
- How to uninstall MicroPython libraries/packages in Thonny IDE?
- How to upload files to your MicroPython Device using Thonny IDE?
- How to format code in Thonny IDE?
- How to run multiple windows or instances of Thonny IDE?
Introduction
This post is a collection of my Thonny IDE how-to guides when working with MicroPython. I will continually update this post for different scenarios or issues that I have encountered when working with this awesome Thonny IDE.
I have written a quick start guide on how to use Thonny IDE in MicroPython if you want a more structured tutorial.
Related Content:
MicroPython Development Using Thonny IDE
Thonny How to Guides:
How to download Thonny IDE?
Go to this URL and download the Thonny installer that is appropriate for your operating system.
How to set the MicroPython interpreter in Thonny IDE?
Click Run then Configure Interpreter
Select the appropriate interpreter for your MicroPython device.
How to connect/re-connect with your MicroPython device in Thonny IDE?
Click the Stop/Restart backend or Ctrl + F2 at the top menu.
How to interrupt running MicroPython script in Thonny IDE?
Click the Run menu and then click the Interrupt Execution.
Thonny IDE: The device is busy or does not respond
Click the interrupt execution button.
How to install MicroPython libraries or packages in Thonny IDE?
First, make sure that your MicroPython Device is connected and detected by Thonny IDE. Please check the above guide if you don’t know how to do this.
Next, interrupt the running MicroPython script. Please check the above guide if you don’t know how to do this.
Click on Tools – Manage Packages
Search for the package that you want to install. In my case, I am looking for uTemplate and then clicking the Search on PyPi button.
When the Search Result comes back then click the package that you want to install.
Click the Install button and when a pop-up comes just click yes.
Your library should be installed in the lib folder of your MicroPython device
How to uninstall MicroPython libraries/packages in Thonny IDE?
First, make sure that your MicroPython Device is connected and detected by Thonny IDE. Please check the above guide if you don’t know how to do this.
Next, interrupt the running MicroPython script. Please check the above guide if you don’t know how to do this.
Click on Tools then Manage Packages.
Select the library or package you want to uninstall. Click the Uninstall button afterwards.
This should delete the library or package in the lib folder of your MicroPython device.
How to upload files to your MicroPython Device using Thonny IDE?
First, interrupt the currently running script in your MicroPython device. Refer to the guide above on how to perform this interrupt if you are not sure.
In your Files Explorer, select all the files that you want to upload and then right-click then select Upload to / submenu.
This will upload the files to your MicroPython device.
How to format code in Thonny IDE?
Install the latest Thonny IDE that is applicable to your operating system. Your Thonny IDE should have a version that is greater than 4.0.
In the search field, type in “thonny-black-formatter” then click it, and then click the Install button.
When you want to format a Python code go to Tools then Format with Black.
How to run multiple windows or instances of Thonny IDE?
By default, Thonny IDE is configured to run only one instance or window of the application. If you need to run multiple instances or windows of the application then you can follow my post about How do you run Thonny IDE with multiple windows or instances?
Support Me!
I love sharing what I know and hopefully, I was able to help you. Writing helpful content takes so much time and research. If you think you like my work and I have managed to help you then please consider supporting my channel. I would be very grateful and would boost my confidence that what I am doing is making a big change in the world. (No Pun Intended!) 😉
Become a Patron!
Leave a Reply