2022年12月12日 星期一

http://kaiching.org/pydoing/py/python-manual.html

關於 Python 語言,這本手冊提供了一個快速認識各項基本要件的導覽,從程式語言 (programming) 的基本概念、標記 (token) 、資料型態 (data type) 、運算子 (operator) 與運算式 (expression) 、控制結構 (control flow) 等等,依 Python 的特性一路講到進階主題,包括類別 (class) 設計與物件導向 (object-oriented) 觀念,以及許多可直接套用的常用功能,如內建函數、內建型態等,每個部份均提供簡單示範,有超過 280 個範例程式。 除了基本語法與廣大的內建項目之外,最後的單元 12 挑選部分 Python 標準程式庫的常用功能做介紹,例如⋯⋯ 內容範例以直接利用 Python 直譯器 (interpreter) 於命令列執行為主,部分利用 Python 的互動式介面呈現,執行結果在各平台如 MS-Windows 、 Mac OS 或 Linux 除了平台專屬功能外都一致。 單元 1 - 基本概念 1.1 標記 1.2 註解 1.3 文件字串 1.4 關鍵字與識別字 1.5 縮排與空白字元 1.6 運算子 1.7 字面常數 1.8 識別字命名規則 單元 2 - 基本內建型態 2.1 變數與物件 2.2 真假值 2.3 數字 2.4 字串 2.5 串列及序對 2.6 Ranges 2.7 字典 2.8 型態轉換規則 單元 3 - 運算子與運算式 3.1 算術運算 3.2 位元運算 3.3 比較運算 3.4 指派運算 3.5 邏輯運算 3.6 del 運算 3.7 is 運算 3.8 in 運算 3.9 lambda 運算 3.10 yield 運算 3.11 串列的綜合運算 單元 4 - 陳述 4.1 簡單陳述 assert 4.2 簡單陳述 pass 4.3 簡單陳述 return 4.4 簡單陳述 raise 4.5 簡單陳述 break 4.6 簡單陳述 continue 4.7 簡單陳述 import from as 4.8 簡單陳述 global 4.9 簡單陳述 nonlocal 4.10 複合陳述 if elif else 4.11 複合陳述 for in else 4.12 複合陳述 while else 4.13 複合陳述 try except finally else 4.14 複合陳述 with as 單元 5 - 函數 5.1 參數 5.2 回傳值 5.3 裝飾子 單元 6 - 類別 6.1 __init__() 6.2 __str__() 6.3 __doc__ 6.4 類別屬性與實體屬性 6.5 static 方法與類別方法 6.6 封裝 6.7 繼承 6.8 子類別的方法改寫 6.9 多重繼承 6.10 多型 6.11 __del__() 6.12 迭代器 6.13 物件模型 單元 7 - 模組與 __name__ 單元 8 - 套件與組織程式庫 單元 9 - 內建函數 9.1 型態相關 bool() bytearray() bytes() complex() dict() float() frozenset() int() list() memoryview() object() range() set() slice() tuple() type() 9.2 串列排序 sorted() 9.3 字串相關 ascii() bin() chr() format() hex() oct() ord() repr() str() 9.4 迭代器相關 all() any() enumerate() filter() iter() map() next() reversed() zip() 9.5 裝飾子相關 classmethod() staticmethod() 9.6 執行相關 compile() eval() exec() 9.7 作用域相關 dir() globals() locals() 9.8 屬性相關 delattr() getattr() hasattr() property() setattr() vars() 9.9 數字處理 abs() divmod() max() min() pow() round() sum() 9.10 檔案處理 open() 9.11 基本輸入輸出 input() print() 9.12 內建說明 help() 9.13 物件相關 callable() hash() id() isinstance() issubclass() len() super() 單元 10 - 內建型態 10.1 串列 list list.append() list.clear() list.copy() list.count() list.extend() list.index() list.insert() list.pop() list.remove() list.reverse() list.sort() 10.2 序對 tuple tuple.count() tuple.index() 10.3 range range.count() range.index() range.start .step .stop 10.4 字串 str str.capitalize() str.casefold() str.center() str.count() str.endswith() str.expandtabs() str.find() str.format() str.format_map() str.index() str.isalnum() str.isalpha() str.isdecimal() str.isdigit() str.isidentifier() str.islower() str.isnumeric() str.isprintable() str.isspace() str.istitle() str.isupper() str.join() str.ljust() str.lower() str.lstrip() str.maketrans() str.partition() str.replace() str.rfind() str.rindex() str.rjust() str.rpartition() str.rsplit() str.rstrip() str.split() str.splitlines() str.startswith() str.strip() str.swapcase() str.title() str.ranslate() str.upper() str.zfill() 10.5 集合 set set.add() set.clear() set.copy() set.difference() set.difference_update() set.discard() set.intersection() set.intersection_update() set.isdisjoint() set.issubset() set.issuperset() set.pop() set.remove() set.symmetric_difference() set.symmetric_difference_update() set.union() set.update() 10.6 frozenset frozenset.copy() frozenset.difference() frozenset.intersection() frozenset.isdisjoint() frozenset.issubset() frozenset.issuperset() frozenset.symmetric_difference() frozenset.union() 10.7 字典 dict dict.clear() dict.copy() dict.fromkeys() dict.get() dict.items() dict.keys() dict.pop() dict.popitem() dict.setdefault() dict.update() dict.values() 10.8 其他內建型態 單元 11 - 內建例外 11.1 基本例外類別 11.2 具體例外類別 11.3 其他內建例外 單元 12 - 標準程式庫導覽 12.1 正規運算式 re 12.2 時間日期處理 datetime 12.3 數字精準度 decimal 12.4 隨機數 random 12.5 檔案與目錄 os.path 12.6 資料庫 sqlite3 12.7 HTML 處理 html.parser 12.8 伺服器 http.server 12.9 圖形介面 tkinter 12.10 發展工具 2to3 pydoc unittest 本書所有範例程式 - 下載連結。 相關教學影片

沒有留言:

張貼留言

Python 標準函式庫 (Standard Library

Python 標準函式庫 (Standard Library) — Python 3.12.0a3 說明文件 ...