TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Any experience with Python-in-the-browser (Python-to-JavaScript) tools?

3 pointsby bakery2kalmost 6 years ago
I have some existing Python code that I would like to run in the browser, without having to rewrite it in JavaScript. Has anyone used any of the tools that allow the use of Python in the browser?<p>There seem to be two classes of such tools:<p>1. Python interpreters written in JavaScript. These include Brython [1], Skulpt [2] and Batavia [3].<p>2. Compilers (a.k.a. transpilers) that convert Python code directly into JavaScript. I would expect this to provide better performance than an interpreter, but perhaps be a less accurate Python implementation. This seems to be the approach taken by Transcrypt [4].<p>Has anyone used any of the above, or similar tools? How did you find them in terms of compatibility, performance etc?<p><pre><code> [1] https:&#x2F;&#x2F;brython.info&#x2F; [2] https:&#x2F;&#x2F;skulpt.org&#x2F; [3] https:&#x2F;&#x2F;github.com&#x2F;beeware&#x2F;batavia [4] https:&#x2F;&#x2F;www.transcrypt.org&#x2F;</code></pre>

2 comments

amirouchealmost 6 years ago
There is also python interpreters compiled to webassembly<p>see: <a href="https:&#x2F;&#x2F;pmp-p.github.io&#x2F;micropython-next&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pmp-p.github.io&#x2F;micropython-next&#x2F;</a><p>see: <a href="https:&#x2F;&#x2F;hyperdev.fr&#x2F;pypyjs-todomvc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hyperdev.fr&#x2F;pypyjs-todomvc&#x2F;</a>
billconanalmost 6 years ago
yes, I&#x27;m using pyodide <a href="https:&#x2F;&#x2F;github.com&#x2F;iodide-project&#x2F;pyodide" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;iodide-project&#x2F;pyodide</a> to build<p><a href="https:&#x2F;&#x2F;epiphany.pub&#x2F;post?refId=d40c08258ef10f2fe9acff4ab738edc3478e8f5deb232f59082bda5e321529c6" rel="nofollow">https:&#x2F;&#x2F;epiphany.pub&#x2F;post?refId=d40c08258ef10f2fe9acff4ab738...</a><p>the loading time is a bit long, because the matplotlib package is too large. loading python runtime is actually fast.<p>compatibility should be 99%, as this is the same cpython built for web.