創建瀏覽器運行Python編程環境

我的數學遊樂場

The idea of running Python in a web browser seems amazing.

Pyodide軟件為什麼能實現瀏覽器上報行Python指令, What is Pyodide?

Pyodide is an open-source library that was started at Mozilla as part of the Iodide project. Pyodide allows a user to run Python in a web browser through having the Python interpreter compiled to Web Assembly (WASM).

讓我想起了, 微信Wechat還可跑微信小程序,現在我去餐館掃碼點餐多方便。

It comes with 75 packages already in the base library, most of which are part of the scientific stack such as NumPy and Pandas. Other packages can be installed if they are pure python wheels from PyPI. Check out the Pyodide library here and the docs here.

Python組件庫是一大特色,對網絡數據收集、數據分析、科學計算、統計及圖表。留之后章節介紹。 JS,没有成熟的数据科学处理库,在浏览器端实现Python全栈科学计算,正是所思所想。 伺服器處理,Thin 唔 Thin 唔重要。問題是伺服器也不能無限加資源,本地機不是也閒着!

初學Python朋友,即上瀏覽器即學習 What use cases can we see Pyodide filling?

Since Python is a great language for beginners, we always keep beginner programmers and students top of mind when we think about who our users are and what they need. We have found that beginner users struggle to install and configure Python and these steps are a barrier during their getting started experience. Additionally, we have seen that some schools who restrict network access on school computers accidentally block students from downloading Python onto a school computer. This was a very compelling use case and so I began exploring it as an option and I learned so much about Pyodide along the way.

個人觀點,持續發展性 Advantages of Pyodide

I think Pyodide brings a whole new set of opportunities to Python that are poised to become very impactful to all different types of developers. The size of Pyodide is a bit big but it is manageable, and the library has great performance speeds that remain constant across Chrome and Edge during our light testing. Since the project is open-source it is simple to add new supported libraries to Pyodide’s current list of 75 packages, and the library in general continues to be actively maintained by a few core contributors. The activity on the Pyodide repo means that issues are being answered quickly and new features. Pyodide is continuously improving, and the limitations right now should not be viewed as static.

Python初級課程(選節)

Beginning Python Tutorial

Defining variables

There are several common types in Python. They are `int`, `float`, `str`, `boolean`, `None`, `list`, `dict`.


Output:

Concatenate string and numberic variables together



Output:

Lab 1: List

# Counting each number


Output:

總結

促進STEM學習,學習基本功。鼓勵大家學習編程。

參考:

  1. pyodide
    "https://github.com/pyodide/pyodide/releases"
    "python -m http.server"
  2. CodeMirror
    https://codemirror.net/5/mode/python/
  3. 我喜愛連結:
    哆嗒数学网·博客