cp2023 40923137

  • Home
    • SMap
    • reveal
    • blog
  • About
  • Brython
  • w4-w5
    • 牛頓第二運動定律
    • mass-spring-damper 系統
    • Eulers Method 數值分析
  • w6-w8
    • 程式練習-1 程式碼練習
    • 程式練習-2 繪製國旗
  • w11
  • w12
  • w13
  • w15
  • w16
  • 課程心得
  • 課程工具
    • Replit
    • ChatGPT
    • Microsoft-Teams
About << Previous Next >> w4-w5

Brython

https://en.wikipedia.org/wiki/Python_(programming_language)

Examples:

https://gist.github.com/mdecycu/d9082d678096bd58378d6afe2c7fa05d

https://www.geeksforgeeks.org/python-programming-examples/

https://www.programiz.com/python-programming/examples

https://www.freecodecamp.org/news/python-code-examples-sample-script-coding-tutorial-for-beginners/

Python Tutorial:

https://docs.python.org/3/tutorial/

An informal introduction to Python

Indentation (Python 採 4 個 Spaces 縮排, 以界定執行範圍)

Variables (Python Keywords)

Comments (# 單行註解, 三個單引號或三個雙引號標註多行註解)

Numbers (整數 int(), 浮點數 float())

Strings (字串)

print (Python 內建函式, print() 函式)

Python control flow tools

for

if

range

open

read

lists

tuples

dictionaries

functions

try ... except

break

pass

classes

這個頁面 demo 如何在同一頁面下納入多個線上 Ace 編輯器與執行按鈕 (practice_html.txt 動態頁面超文件).

practice_html.txt 動態頁面超文件應該可以在啟動 Brython 時, 設定將 .py 檔案放入 downloads/py 目錄中引用.

亦即將所有對應的 html 也使用 Brython 產生, 然後寫為 class 後, 在範例導入時透過 instance 引用.

<!-- 啟動 Brython -->
<script>
window.onload=function(){
brython({debug:1, pythonpath:['./../cmsimde/static/','./../downloads/py/']});
}
</script>

從 1 累加到 100:

將 iterable 與 iterator 相關說明, 利用 Brython 與 Ace Editor 整理在這個頁面.


從 1 累加到 100 part2:


About << Previous Next >> w4-w5

Copyright © All rights reserved | This template is made with by Colorlib