VPython in pyscript?

I posted this in the repo before I saw this site, but this might be of general interest: I just learned of this project and I’m excited about it. I’m the lead developer of Web VPython (webvpython.org). You log into the site and can write VPython programs that are saved in the cloud. Click “Run this program” and your Python code is transpiled in the browser to JavaScript using RapydScript-NG, and execution of the JavaScript code is done in the browser, using WebGL 2 to produce the 3D scene. This environment is used by both programming novices and experts. It does have the limitation that you can’t import Python modules (you can import JavaScript libraries), but you can run the same VPython programs with installed Python if you need other Python modules. VPython makes it easy rather than very difficult to write Python programs that generate as a side effect of computations navigable real-time 3D animations. For example, run Web VPython, play with the camera controls, then click “View this program” to see how remarkably short it is. As you can see, it would be a Big Win if Web VPython could use pyscript, thereby 1) being significantly more conformant to genuine Python and 2) making it possible to import Python modules.

1 Like

Nice to meet you.

I would like to use it on the intranet Web of physics simulators and mechanical engineering simulators that must use VPython.

Thank you for posting.

Regards, you.