
Python in Apps
Proof of concept showing Python running inside Omni apps via Pyodide, a WebAssembly port of Python that executes in the browser. A K-means clustering algorithm reruns on input change, with…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
The second little thing is, uh, this morning Mark wrote about meeting with a client who asked, “Hey, can we eventually use Python in applications?” I know you're working on Python, and when that comes to fruition, can I have a Python script that runs the application? And I thought, "I think you can do this already." So, this is an application that runs Python.
This is a clustering algorithm, K-means clustering. If I change it, it will restart Python, and to prove to you that this is Python, let me open my code editor. Uh-huh. And here is your Python script. You see, this isn't JavaScript, this is Python. This has some limitations because it runs in the browser, but it takes query results from your database and passes them through Pyodide—a WebAssembly-based version of Python that can run in the browser.
So it's more of a proof of concept that apps can do a lot of things. If you're wondering if it's possible to do something in apps—just try it. There is a good chance that everything will work out. This is just great. And theoretically, by the way, you could also run R in the browser. There is a WebAssembly-based version of R.
It doesn't work right now because it relies on a blob worker, which is blocked by the sandbox, but there are ways to make it work. So JavaScript can do a lot of things. This is very cool. This is compiling Python into WASM and running it in the browser. Yes, that's right. Ugh . Yes, there is. For all customers watching: there will be restrictions.
We do not run Python on your server. No, this is purely a proof of concept. Yes, there are many restrictions. So, this is not related to the current work we are doing on Python to add it to applications. True? Absolutely not. OK. Yes.