Skip to content

Create Imported Mode Sketch Server for use by Thonny #557

@hx2A

Description

@hx2A

From this discussion:

https://discourse.processing.org/t/new-windows-portable-bundle-with-thonny-ide-and-py5-0-10-0a0-out/43967/8

points out that running a Sketch through Thonny has an undesirable delay between the user hits the run button and when the Sketch window is open. Part of the delay is because the computer must start a new process that starts the JVM with all off the necessary Processing and py5 Jar files. Simply importing py5 itself does take a few seconds:

In [1]: %time import py5
Importing py5 on macOS but the necessary Jupyter macOS event loop has not been activated. I'll activate it for you, but next time, execute `%gui osx` before importing this library.
CPU times: user 3.19 s, sys: 708 ms, total: 3.9 s
Wall time: 4.99 s

And this machine in front of me is a MacBook Pro with an M1 chip.

Thonny launches each imported mode Sketch with a separate call to the command line tool, which must import py5 again each time. It would better to have some kind of Sketch server that imports py5 once and accepts requests from a client (ie Thonny) to launch Sketches. I don't think this would be that hard to build.

Also, such a Sketch server would be a better fit for using py5 via the PDE. The Sketch server doesn't magically solve some of the other PDE related problems discussed elsewhere but it would be a positive step for py5 + PDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions