Pyodide#
Pyodide 是一個基於 WebAssembly,適用於瀏覽器和 Node.js 的 Python 散佈版。
什麼是 Pyodide?#
Pyodide 是將 CPython 移植到 WebAssembly/Emscripten 的產物。
Pyodide 讓開發者能透過 micropip 在瀏覽器中安裝並執行 Python 軟體包。任何在 PyPi 上提供 wheel 檔的純 Python 軟體包皆受支援。許多包含 C、C++ 和 Rust 擴充功能的軟體包也已移植至 Pyodide 使用,其中包括 regex、PyYAML 和 cryptography 等多種通用軟體包,以及 NumPy、pandas、SciPy、Matplotlib 和 scikit-learn 等科學運算 Python 套件。
Pyodide 附帶了強大的 Javascript ⟺ Python 外部函數介面,讓您可以在程式碼中自由混合這兩種語言,且摩擦極小。這包括對錯誤處理(在一種語言中拋出錯誤,在另一種語言中擷取)、async/await 等功能的完整支援。
在瀏覽器中使用時,Python 具有存取 Web API 的完整權限。
Try Pyodide#
Try Pyodide in a REPL directly in your browser (no installation needed).
What should I look at first?#
If you wish to use a hosted distribution of Pyodide: see the Getting started documentation.
If you wish to host Pyodide yourself, you can download Pyodide from the releases page and serve it with a web server.
If you wish to use Pyodide with a bundler, see the documentation on Working with Bundlers.
If you are a Python package maintainer, see the pyodide-build documentation.
If you want to add a package to the Pyodide distribution, see the pyodide-build documentation.
If you wish to experiment or contribute back to the Pyodide runtime, see the documentation on Building from source.
目次表#
使用 Pyodide#
開發#
The Development section helps Pyodide contributors to find information about the development process including making packages to support third party libraries.
專案#
The Project section gives additional information about the project's organization and latest releases.
Communication#
Discord:discord.gg/cRxMCG5kJQ
Twitter: twitter.com/pyodide
Stack Overflow:stackoverflow.com/questions/tagged/pyodide