Package: thonny-py5mode
thonny-py5modeA py5 plug-in for ThonnyUse theThonny Python IDEas a Processing PDE alternative for creative coding.Thonny-py5modeis a plug-in that installs and configures Thonny for use withpy5, a Python (3.8+) framework that leverages Processing's core libraries.InstructionsIf you already have some version of Thonnythat includes Python 3.8+on your computer, you can skip straight to step 4.Download and install the Thonny 3.3.7-altversion of the Thonny IDE (for Python 3.9 support) fromgithub.com/thonny/thonny/releases/tag/v3.3.7:thonny-3.3.7-alt.exe<- for Windowsthonny-3.3.7-alt.pkg<- for MacOSthonny-3.3.7-x86_64-alt.tar.gz<- for LinuxThe Thonny 4 IDE (currently in beta) ships with Python 3.10. The thonny-py5mode plug-in should run fine on Thonny 4 for Linux; itshouldalso work with macOS and Windows. Expanding theAssetsfor any releasewill reveal the downloads for Windows/macOS/Linux --Start Thonny. If you're running it for the first time, just accept theStandardsettings.Once Thonny is open, selectTools > Manage plugins...Then search for and install thethonny-py5modeplug-in --You mustrestart Thonnyafter this step.When you've restarted Thonny, selectpy5 > Imported mode for py5--ClickProceedto 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 --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 usingpy5 > Apply recommended py5 settingsWhen the py5Imported mode for py5option is checked, Thonny can run your py5 code --Test out animported modesketch by clicking the green play button (or using the F5 or Ctrl+R keyboard shortcuts). Here is some code:defsetup():size(300,200)rect_mode(CENTER)defdraw():rect(mouse_x,mouse_y,10,10)NOTE: This mode also runsstatic modesketches (when you don't need adraw()function for animation).Click the stop-sign (🛑) button in the Thonny toolbar to stop your sketch.Module Mode SketchesTo run a py5module modesketch, deactivate/uncheckpy5 > Imported mode for py5first so that Thonny returns to its normal run behaviour (for running any Python script). As an example, you can try this code:importpy5defsetup():py5.size(300,200)py5.rect_mode(py5.CENTER)defdraw():py5.square(py5.mouse_x,py5.mouse_y,10)py5.run_sketch()Note that module mode requires animport py5andrun_sketch()line, andpy5.prefixes.Useful py5 resourcespy5 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) --py5 cheatsheetpy5 discussions/forumpy5 documentationpy5 examplesProcessing forum (Python channel)Villares' sketch-a-day archiveCreditsThanksvillaresfor inspiring me to develop this plug-in,hx2Afor the awesomepy5 project, and theThonny folksfor their fantastic IDE. TheColor Selectorincorporates Juliette Monsel's excellenttkColorPickermodule.Todo ListSeediscussions on GitHub repo. This plug-in is a work in progress ... please report issueshere.