TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

3 点作者 bakery2k将近 6 年前
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 条评论

amirouche将近 6 年前
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>
billconan将近 6 年前
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.