-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable a pyodide mode #124
Comments
One important thing to address is: why not improve @Luxapodular initial work? In my opinion the reasons are:
Anyway, I REALLY glad for @Luxapodular to opened up this world of possibilities with p5.js and Python with his code!!! Seriously, thanks a lot! |
I know there are some people in this issue interested in this discussion, so I invite you to take a loot in this demo I've released today: |
Hi there, Just to let you know that I managed to wrap p5.js for Basthon (which uses Pyodide under the hood). This notebook is an example but you can find more at the end of this gallery. The code is here. I took a rather different approach that might be equivalent to yours at some point. Basically, it
This is all procedural and there is no global instance variable exposed to I would like to thank you for this nice work that was a good starting point for integrating p5.js in Basthon. |
@casatir thanks for your message! Your strategy is very interesting actually! It's way more pythonic than mine. Thanks for the reference and congrats for Basthon! It seems to be a cool project =) |
The p5 package from Basthon depends on a ‘basthon’ package. I’m not sure if any of this is needed yet, so provide a fake implementation of that package in the pyodide environment. This GitHub comment led me in a useful direction: berinhard/pyp5js#124 (comment) kernel.display_event() is called from this file: https://framagit.org/basthon/basthon-kernel/-/blob/master/packages/kernel-python3/src/modules/p5/p5/_core.py#L82-83 kernel.locals().get() and kernel.locals().keys() are called from this file: https://framagit.org/basthon/basthon-kernel/-/blob/master/packages/kernel-python3/src/modules/p5/p5/_nsmanager.py#L25
This issue comes from the #123 proof of concept and it goals a full support of pyp5js with Pyodide.
The backend
pyp5js new
command to enable people to keep on using Transcrypt;2.1 This will probably result on a need of a "config" file for the sketch, something like Processing's
sketch.properties
. I think a JSON to hold this data would be good enough for now;monitor
command to work with pyodide as well;The text was updated successfully, but these errors were encountered: