py5 mode plugin for Thonny
Project description
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.
This plug-in will work with the portable version of Thonny. It's also likely to work with Thonny versions that include an installer.
Development on this package has just begun; thonny-py5mode is still in its experimental stages. It's only tested on Linux right now; it might work on Windows. You should be aware that there are a few py5 issues with Mac (OSX) computers.
Instructions
These are instructions for Linux. You'll need to adapt steps 1, 2, 3 for other platforms. Where applicable, there are notes for non-portable/installed versions of Thonny. You can skip straight to step 4 if you already have some version of Thonny that includes Python 3.8+ on your computer.
-
Download the -alt version of the Thonny IDE (for Python 3.9 support) from: https://github.com/thonny/thonny/releases/tag/v3.3.7 (grab thonny-3.3.7-x86_64-alt.tar.gz for Linux)
-
Extract this archive and place the thonny folder wherever you like on your computer (this runs as a portable app, no installer required).
-
In the newly-extracted thonny folder, locate and run
bin/thonny
.If you're running Thonny for the first time, just accept the default Standard settings.
-
Once Thonny is open, select Tools > Manage plugins...
Then search for and install thonny-py5mode (note you'll need to restart Thonny after this step).
-
When you've restarted Thonny, select py5 > Activate py5 mode for Thonny -- this will download and extract JDK-11 into the Thonny user-config directory (
~/.config/Thonny
on Linux). You'll have to activate this mode when you want to use py5 (but the download only happens on the first occasion).NOTE: Thonny will appear to freeze for a while when it's downloading JDK (the plug-in needs a proper progress indicator) --
But, you'll be notified once the download is done.
-
Try out an imported mode sketch using py5 > Run imported mode sketch (or using Ctrl+U).
def setup(): size(500, 500) fill(255, 0, 0) no_stroke() def draw(): circle(mouse_x, mouse_y, 10)
NOTE: you'll need to save your sketch (File > Save as...) somewhere first. After that, Thonny saves the file for you each time you run it.
Module Mode Sketches
You can run a py5 module mode sketch using the standard Thonny run menu (Run > Run current script). Be sure to py5 > Activate py5 mode for Thonny (this should be checked). As an example, you can try this code:
import py5
def setup():
py5.size(200, 200)
py5.rect_mode(py5.CENTER)
def draw():
py5.square(py5.mouse_x, py5.mouse_y, 10)
py5.run_sketch()
Credits
I was inspired to get started on this by villares' experiment, and thonny-py5mode will likely end up integrated into this.
If you're interested in Python for creative coding and don't know about hx2A's py5 project, you need to check it out now!
Todo List
Get startedAdd tickable/toggled menu optionAdd support for non-portable/installed version of Thonny- Display download/installation progress in Thonny (not the terminal)
Add support for py5 imported mode- Fix portable mode
- Auto-completion for module mode
- Highlighting for py5 code
- ...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file thonny-py5mode-0.1.14a0.tar.gz
.
File metadata
- Download URL: thonny-py5mode-0.1.14a0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ed49ae83733a20ac1f4e742a1c78e83539e4adb9589ef0ca80d399e53672531 |
|
MD5 | c88b986171bc4f5ad9d8ad031b8248f5 |
|
BLAKE2b-256 | d1892427f7bca76f03ad418acf1e23c78193a6325c3355457b44a9acd30514d9 |
File details
Details for the file thonny_py5mode-0.1.14a0-py3-none-any.whl
.
File metadata
- Download URL: thonny_py5mode-0.1.14a0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4436be21391c68fc5b3a2e0423c195fa8b4816d62665d39340154d7acb7aec5e |
|
MD5 | 9bf93ac2dd62468d1aadf8613da364ea |
|
BLAKE2b-256 | f35850c8155a2fd914b1901ab361bf81cea63f5bf4f7ecfe38c9930650f90dc8 |