Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

thonny-py5mode

A py5 plug-in for Thonny

Use the Thonny Python IDE as a Processing PDE alternative for creative coding. Thonny-py5mode is a plug-in that installs and configures Thonny for use with py5, a Python (3.8+) framework that leverages Processing's core libraries.

Instructions

If you already have some version of Thonny that includes Python 3.8+ on your computer, you can skip straight to step 4.

  1. Download and install the Thonny IDE from https://github.com/thonny/thonny/releases. Expanding the Assets will reveal the downloads for Windows/macOS/Linux --

    For your convenience, here are direct links to the downloads for Thonny 4.1.4:

    The thonny-py5mode plug-in will run fine with Thonny 4 because it ships with Python 3.10.

  2. Start Thonny. If you're running it for the first time, just accept the Standard settings.

3a. Once Thonny is open, select Tools > Manage packages...

Then search for and install the py5 library --

3b. Still in Thonny, select Tools > Manage plugins...

Then search for and install the thonny-py5mode plug-in --

You must restart Thonny after this step.

  1. When you've restarted Thonny, select py5 > Imported mode for py5 --

    Click Proceed to download, extract, and set up JDK-17 (if you need to know: the plug-in installs JDK in the Thonny user-config directory). Thonny only needs to download JDK the first time you switch to imported mode.

    You'll be notified once this process completes --

  2. This step is optional. There are several Thonny settings that I recommend you apply for working with py5 (including a Processing 4 inspired theme, Kyanite). You can apply those settings in one simple step using py5 > Apply recommended py5 settings

  3. When the py5 Imported mode for py5 option is checked, Thonny can run your py5 code --

    Test out an imported mode sketch by clicking the green play button (or using the F5 or Ctrl+R keyboard shortcuts). Here is some code:

    def setup():
        size(300, 200)
        rect_mode(CENTER)
    
    def draw():
        rect(mouse_x, mouse_y, 10, 10)
    

    NOTE: This mode also runs static mode sketches (when you don't need a draw() function for animation).

    Click the stop-sign (🛑) button in the Thonny toolbar to stop your sketch.

Module Mode Sketches

To run a py5 module mode sketch, deactivate/uncheck py5 > Imported mode for py5 first so that Thonny returns to its normal run behaviour (for running any Python script). As an example, you can try this code:

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 module mode requires an import py5 and run_sketch() line, and py5. prefixes.

Useful py5 resources

py5 is a new version of Processing for Python 3.8+. It makes the Java Processing jars available to the CPython interpreter using JPype. It can do just about everything Processing can do, except with Python instead of Java code. Here are some useful py5 resources (alphabetically listed) --

Credits

Thanks villares for inspiring me to develop this plug-in, hx2A for the awesome py5 project, and the Thonny folks for their fantastic IDE. The Color selector incorporates Juliette Monsel's excellent tkColorPicker module.

Todo List

See discussions on GitHub repo. This plug-in is a work in progress ... please report issues here.

Metadata

Release files for thonny-py5mode 0.4.7a0

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.4.7a0
File Size Uploaded
thonny_py5mode-0.4.7a0.tar.gz 22.1 kB Details

Built distribution (wheel)

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

Total release size: 54.0 kB

Release files / thonny_py5mode-0.4.7a0.tar.gz

Download URL thonny_py5mode-0.4.7a0.tar.gz
Size 22.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4ef715dfd918c4ee314d1759d0c0a2cb94d312c9af93a464c0a97b8c5807c187
BLAKE2b-256 checksum
How to use checksums
147fa6bbe19448cda1a7310e6ea14c86d84c0b1541ebd67330c8d55a13267d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / thonny_py5mode-0.4.7a0-py3-none-any.whl

Download URL thonny_py5mode-0.4.7a0-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd60bb03f3eededc70730b6c758020b77873315d2c67202d71a9f16a6ee1576e
BLAKE2b-256 checksum
How to use checksums
5729f1fdeda1d440cfc63abda9cdf94cadcdbca6d7676853758437630377e918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12
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