PyScript:浏览器中 Python 的开源平台
PyScript: An open source platform for Python in the browser

原始链接: https://pyscript.net/

使用 PyScript 直接在 Web 浏览器中运行 Python 脚本,PyScript 是一个创新的开源平台,它将 Python 的强大功能与万维网的广泛影响力相结合。 通过利用现有浏览器作为执行环境,PyScript 简化了应用程序创建,无需复杂的安装,同时通过使用流行且广泛采用的 Python 编程语言,仍然提供易用性、可扩展性、可共享性、通用性、安全性和表现力。

此示例演示了一个公开可用的仪表板,使用 Pyscript 显示达拉斯犯罪统计数据,Pyscript 是编译为 Web Assembly (WASM) 的 Python 解释器,允许 Python 代码在浏览器中的脚本标记内执行。 该用户指出,他们合作的大多数企业都使用免费版本的 Tableau,并且由于连接到数据存储的限制而手动更新数据。 他们建议将此示例作为免费替代方案,使用 GitHub 操作创建压缩的 CSV 文件,然后将其加载到环境中。 虽然启动过程大约需要一分钟才能完成(包括库安装和初始数据集加载),但生成的应用程序运行平稳并且在移动设备上运行良好。 作者承认,与传统的服务器端数据分析和操作相比,这种方法需要做出一些牺牲,但得出的结论是,对于某些场景来说,这是一个合理的折衷方案。 此外,作者提到他们的其他示例主要是用 JavaScript/D3 编写的,而有些实例需要特定的 Python 数值库来执行复杂的操作,例如 ARIMA 模型或空间聚类。 总的来说,该示例提供了一个令人印象深刻且高效的解决方案,用于查看和分析本地数据集,而无需依赖服务器或其他软件订阅。
相关文章

原文
                            Wouldn't it be cool...
                            to run Python...
                            in your browser?
                            

<html>|

  ...|

  <script type="py">
    print('You can!')
  </script>|

</html>|

|

PyScript is an open source platform for Python in the browser.

PyScript brings together two of the most vibrant technical ecosystems on the planet. If the web and Python had a baby, you'd get PyScript.

At the core of PyScript is a philosophy of digital empowerment. The web is the world's most ubiquitous computing platform, mature and familiar to billions of people. Python is one of the world's most popular programming languages.

With PyScript, Python runs anywhere there's a browser (which is everywhere).

  • Easy: your apps run in the browser with no complicated installation required.
  • Expressive: create apps with a powerful, popular and easy to learn language like Python.
  • Scalable: no need for expensive infrastructure ~ your code runs in your user's browser.
  • Shareable: applications are just a URL on the web. That's it!
  • Universal: your code runs anywhere a browser runs... which is everywhere!
  • Secure: PyScript runs in the world's most battle-tested computing platform, the browser!
  • Powerful: the best of the web and Python, together at last.
联系我们 contact @ memedata.com