Code Pico with Thonny
By Lucy Hattersley. Posted

1. Open Thonny
The best way to program in MicroPython on your Raspberry Pi Pico is with the Thonny Python IDE (integrated development environment). Open the Raspberry Pi menu and choose: Programming > Thonny Python IDE.
If you are using a non-Raspberry Pi computer you may have to install Thonny. Follow the instructions at thonny.org.
Scroll for steps two and three.
Advertisement
The desktop computer you've been waiting for: Raspberry Pi 500+
2. Choose interpreter
Thonny is normally used to write programs that run on the same computer you’re using Thonny on; to switch to writing programs on your Raspberry Pi Pico, you’ll need to choose a new Python interpreter. Look at the bottom-right of the Thonny window for the word ‘Python’ followed by a version number: that’s your current interpreter.
Click ‘Python’ and look through the list that appears for ‘MicroPython (Raspberry Pi Pico)’ – or, if you’re running an older version of Thonny, ‘MicroPython (generic)’.
3. Hello World
Writing a program for your Raspberry Pi Pico is a lot like writing a program for your Raspberry Pi. You can type commands in the Shell area at the bottom of the window to have them immediately executed, or you can write a program in the main part of the window to run on-demand.
Click in the Shell area, next to the >>>> symbols, and type:
print("Hello, World!")
When you press ENTER at the end of the line, you’ll see your Raspberry Pi Pico respond.
You are now ready to start writing your MicroPython code in the main window. Click Run to start the program on Raspberry Pi Pico. Take a read of our book, Get Started with MicroPython on Raspberry Pi Pico if you want to learn more about Pico programming.
Top tip: Update Thonny
If you don’t see ‘MicroPython (Raspberry Pi Pico)’ in the interpreter list, you’ll need to update Thonny. Open a Terminal window and type:
sudo apt update && sudo apt full-upgrade -y

Lucy is Editor of Raspberry Pi Official Magazine.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles

Raspberry Pi 500+ in Raspberry Pi Official Magazine issue 158
We’re quite taken with Raspberry Pi 500+. But when you don’t need all that processing power, and just want a board that will make a plastic skeleton jump around in a terrifying manner, you’ll find Raspberry Pi Pico more than up to the job. There’s more terror in the magazine (which is only right as […]
Read more →

Win one of five Raspberry Pi SSD 1TB
Raspberry Pi prides itself on high quality hardware, and this 1TB Raspberry Pi SSD is no different. You can use it with a standard Raspberry Pi or even in your desktop PC – the choice is yours. We have five to give away and you can enter below Win 1 of 5 Raspberry Pi SSD […]
Read more →

Dual-screen cyberdeck
Twin screens mean you can code on one screen while watching David Bowie’s 1978 Musikladen show on the other.
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.