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, extract and setup JDK-11 for you (if you need to know: it's in 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 select py5 > Activate py5 mode for Thonny first (this should be checked to run py5). 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.15a0.tar.gz
.
File metadata
- Download URL: thonny-py5mode-0.1.15a0.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 | 0bcdfbb6af47579d0a676117853e3cd3bc0a4e82426edb9fcd7b6ba42f8064df |
|
MD5 | 159ee22047a812ad5a3a75a7c9925c6b |
|
BLAKE2b-256 | 06b8884797d73187227e302b3954392d021b248e66800eb8d237e55cef0b410e |
File details
Details for the file thonny_py5mode-0.1.15a0-py3-none-any.whl
.
File metadata
- Download URL: thonny_py5mode-0.1.15a0-py3-none-any.whl
- Upload date:
- Size: 6.9 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 | 30c9191367447f4301685e7a775e91f22f4b3b9dfecc148921bbb32164d26420 |
|
MD5 | fd0bf420a7080e4f1a7fccef36415e21 |
|
BLAKE2b-256 | e9016b0e197829390fd0c87addb7ae603e7e91b53dfe9b12a7818ba64c8ca09e |