Skip to main content

thonny-py5mode

A py5 plug-in for Thonny

This plug-in for the Thonny IDE can install py5, a modern Python framework that leverages Processing's core libraries, adding an imported mode for py5 feature to Thonny, making it a great alternative for creative coding with Python in a simplified manner similar to the Processing IDE (PDE).

Instructions

1. Download and install the Thonny IDE

If you have the latest version of Thonny on your computer, you can skip straight to step 2.

You can download it for Mac, Windows and Linux from https://thonny.org or from Thonny's repository releases.

Then you launch Thonny, and If you're running it for the first time, just accept the Standard settings.

2. Install the thonny-py5mode plug-in

From Thonny's menu, choose the Tools > Manage plug-ins... menu item.

Search for thonny-py5mode it needs to be typed exactly like this.

Click on the blue thonny-py5mode link.

Click on the Install button. When the installation is complete, you'll need to restart Thonny.

Once restarted, a new py5 menu should appear in Thonny's interface, click on the py5 > Imported mode for py5 menu option.

When you first select this, the plug-in will download, extract and configure the JDK for you (in Thonny's user-config directory).

Allow it to proceed, and be patient as this process can be lengthy depending on your connection, but it only happens the first time you select the menu option.

A message will appear when it is finished.

You can apply recommended py5 settings to make a few configuration tweaks to your IDE, including enabling the blue Kianite theme!

3. Run a small example, to check everything is working!

With the py5 > imported mode for py5 option on, you can run the following code using the green arrow button or CTRL+R (COMMAND+R on a Mac). Creative coders usually call their programs sketches.

def setup():
    size(300, 200)
    rect_mode(CENTER)

def draw():
    square(mouse_x, mouse_y, 10)

If you have trouble getting your program to execute, try stopping any other execution that is still running.

Learn about the difference between imported mode and module mode

What is the imported mode feature provided by the thonny-py5mode plug-in?

The thonny-py5mode plug-in creates a py5 menu in the Thonny interface, inside the py5 menu, there is an Imported mode for py5 option that can be turned on or off. When Imported mode for py5 is on you can write your sketches in a simplified manner, called imported mode. It works by making Thonny run your code using the py5 sketch runner, a special tool that can also be called from the command line if you are not using Thonny.

Important note: The imported mode option is not appropriate for executing Python code that doesn't make use of the py5 library!

In imported mode the vocabulary of py5, that is, the names of functions, constants and system variables (such as the mouse position), are available without the py5. prefix (needed on module mode, more about it later), and your program will be automatically executed by the run_sketch function from py5.

With imported mode on, you can also run static mode sketches, that is, programs without animation or interactivity because they do not have a draw() function defined.

What is module mode and how can I use it?

When you disable the imported mode for py5 menu option, you return Thonny to its normal behavior for executing any Python code.

In this case, you can use py5 in module mode, which is how most Python libraries are handled, i.e. importing the library at the beginning of the program with import, and calling its functions with the library name as a prefix.

import py5

def setup():
    py5.size(300, 200)
    py5.rect_mode(py5.CENTER)

def draw():
    py5.square(py5.mouse_x, py5.mouse_y, 10)

py5.run_sketch()

Note that you will need to use import py5 at the beginning of your code, and py5.run_sketch() at the end, as well as the py5. prefix for all functions, constants and variables offered by the py5 library.

Useful py5 resources

Credits

The thonny-py5mode plug-in was initially developed by @tabreturn, who was inspired by a proof of concept by @villares, being thankful to @hx2A for the py5 project, and the Thonny folks for their fantastic IDE. The Color selector incorporates Juliette Monsel's excellent tkColorPicker module. From 2025 onward the plug-in became a part of the py5 project and is maintained by its community.

Contributing

Follow discussions on the thonny-py5mode plug-in GitHub repository and report issues.

Metadata

Release files for thonny-py5mode 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thonny-py5mode 0.5.0
File Size Uploaded Provenance Actions
thonny_py5mode-0.5.0.tar.gz 25.0 kB Without provenance Details for thonny_py5mode-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thonny-py5mode 0.5.0
File Interpreter ABI Platform Actions
thonny_py5mode-0.5.0-py3-none-any.whl Python 3 none any Details for thonny_py5mode-0.5.0-py3-none-any.whl

Total release size: 60.1 kB

Release files / thonny_py5mode-0.5.0.tar.gz

Download URL thonny_py5mode-0.5.0.tar.gz
Size 25.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1362503b9cc7a2e31b4687df63d12e016c4efc737418e3eec7c3f7d0a1a95b61
BLAKE2b-256 checksum
How to use checksums
0ad4c1e5529a97a8bd3c515f708436daf800ac63bee920b0b6cc1daa7aecfa54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.19

Release files / thonny_py5mode-0.5.0-py3-none-any.whl

Download URL thonny_py5mode-0.5.0-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2cb721cc21b73c944d243011679ad23d34bc151671d9c6db4b74ff38c00fbfa
BLAKE2b-256 checksum
How to use checksums
179daf17197c511acc58819a43ca2aaca08f253a92c71c3ffb3a8b9da2eb4821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.19

Security for thonny-py5mode 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page