ipyp5 icon indicating copy to clipboard operation
ipyp5 copied to clipboard

pyp5js

Open jf--- opened this issue 6 years ago • 5 comments

The readme.md states that

The ideal goal (disclaimer: not implemented yet) would be to write code like this in a notebook cell

looks like pyp5js just might be the ticket?

jf--- avatar Jul 01 '19 20:07 jf---

It does looks like a great tool indeed.

Thanks @jf--- for sharing this!

jtpio avatar Jul 03 '19 08:07 jtpio

I was about open an issue to share pyp5js which can be helpful to this project to achieve its goals.

Apparently pyp5js, don't really allows you to display canvas within Jupyter notebook but in a separate html file running on a http server. @jtpio I'd really love to see that ipyp5 can utilize pyp5js in some way to make p5.js work within notebook as widgets while allowing to write pure native Python code. :raised_hands:

jaladh-singhal avatar Nov 01 '20 15:11 jaladh-singhal

Thanks @jaladh-singhal!

Yes pyp5js looks like the most promising way to get that to work.

Maybe using a pyodide mode: https://github.com/berinhard/pyp5js/issues/124

Or using some parts from https://github.com/berinhard/pyp5js/pull/123, with direct calls to pyodide.runPython(code) from the widget frontend.

jtpio avatar Nov 02 '20 09:11 jtpio

Hi everyone! Veeeery cool project you're developing over here! Let me know how I can help with anything. About the pyodide integration, I organized it a little bit better in this demo. It's still a proof of concept and a few things can break (pop for example), but at least it's a reference.

I'll watch the repo and check if I can help with something. I've went through a lot of things trying to make pyp5js to work that can sum to ipyp5 as well.

berinhard avatar Nov 03 '20 17:11 berinhard

Thanks @berinhard!

This demo is going to be very useful, and the project is really exciting!

Looks like it might actually be simpler to try this approach of using pyp5js with pyodide in the p5 notebook first: https://github.com/jtpio/p5-notebook/issues/50

This would leave the issue of syncing the Python code over websockets using the Jupyter Widget protocol for later (but the learnings from p5 notebook could probably be backported here).

jtpio avatar Nov 05 '20 17:11 jtpio