There has actually been quite a lot of work in this area. A colleague of mine wrote up a comparison of several solutions last year:
https://anvil.works/blog/python-in-the-browser-talk
We build our all-Python full stack dev environment (https://anvil.works) on Skulpt - but there's a lot of room in that solution space! If you haven't checked out Mozilla's Pyodide project, for example, it's truly impressive - they compiled all of CPython and popular data science libraries to wasm for a full notebook experience in your browser: