René's URL Explorer Experiment


Title: 程式開發常見問答集 — Python 3.14.0 說明文件

direct link

Domain: python.github.io

readthedocs-addons-api-version1

Links:

https://www.python.org/
目錄https://python.github.io/python-docs-zh-tw/contents.html
程式開發常見問答集https://python.github.io/python-docs-zh-tw/faq/programming.html
常見問題https://python.github.io/python-docs-zh-tw/faq/programming.html#general-questions
核心語言https://python.github.io/python-docs-zh-tw/faq/programming.html#core-language
數字和字串https://python.github.io/python-docs-zh-tw/faq/programming.html#numbers-and-strings
效能https://python.github.io/python-docs-zh-tw/faq/programming.html#performance
序列(元組/串列)https://python.github.io/python-docs-zh-tw/faq/programming.html#sequences-tuples-lists
物件https://python.github.io/python-docs-zh-tw/faq/programming.html#objects
模組https://python.github.io/python-docs-zh-tw/faq/programming.html#modules
一般的 Python 常見問答集https://python.github.io/python-docs-zh-tw/faq/general.html
設計和歷史常見問答集https://python.github.io/python-docs-zh-tw/faq/design.html
回報錯誤https://python.github.io/python-docs-zh-tw/bugs.html
顯示原始碼 https://github.com/python/cpython/blob/main/Doc/faq/programming.rst?plain=1
索引https://python.github.io/python-docs-zh-tw/genindex.html
模組https://python.github.io/python-docs-zh-tw/py-modindex.html
下一頁https://python.github.io/python-docs-zh-tw/faq/design.html
上一頁https://python.github.io/python-docs-zh-tw/faq/general.html
Pythonhttps://www.python.org/
3.14.0 Documentationhttps://python.github.io/python-docs-zh-tw/index.html
Python 常見問題https://python.github.io/python-docs-zh-tw/faq/index.html
程式開發常見問答集https://python.github.io/python-docs-zh-tw/faq/programming.html
程式開發常見問答集https://python.github.io/python-docs-zh-tw/faq/programming.html#id3
https://python.github.io/python-docs-zh-tw/faq/programming.html#programming-faq
程式開發常見問答集https://python.github.io/python-docs-zh-tw/faq/programming.html#programming-faq
常見問題https://python.github.io/python-docs-zh-tw/faq/programming.html#general-questions
是否有可以使用在程式碼階段,具有中斷點,步驟執行等功能的除錯器?https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-a-source-code-level-debugger-with-breakpoints-single-stepping-etc
有沒有工具能夠幫忙找 bug 或執行靜態分析?https://python.github.io/python-docs-zh-tw/faq/programming.html#are-there-tools-to-help-find-bugs-or-perform-static-analysis
如何從 Python 腳本建立獨立的二進位檔案?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-create-a-stand-alone-binary-from-a-python-script
Python 程式碼是否有編碼標準或風格指南?https://python.github.io/python-docs-zh-tw/faq/programming.html#are-there-coding-standards-or-a-style-guide-for-python-programs
核心語言https://python.github.io/python-docs-zh-tw/faq/programming.html#core-language
為什麼當變數有值時,我仍得到錯誤訊息 UnboundLocalError?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value
Python 的區域變數和全域變數有什麼規則?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python
為什麼以不同的值在迴圈中定義的 lambda 都回傳相同的結果?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result
如何跨模組共享全域變數?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-share-global-variables-across-modules
在模組中使用 import 的「最佳實踐」有哪些?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-are-the-best-practices-for-using-import-in-a-module
為什麼物件之間共享預設值?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-are-default-values-shared-between-objects
How can I pass optional or keyword parameters from one function to another?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-pass-optional-or-keyword-parameters-from-one-function-to-another
引數 (arguments) 和參數 (parameters) 有什麼區別?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-the-difference-between-arguments-and-parameters
為什麼更改串列 'y' 也會更改串列 'x'?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-did-changing-list-y-also-change-list-x
如何編寫帶有輸出參數的函式(透過傳參照呼叫 (call by reference))?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-write-a-function-with-output-parameters-call-by-reference
你如何在 Python 中建立高階函式?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-make-a-higher-order-function-in-python
如何在 Python 中複製物件?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-copy-an-object-in-python
如何找到物件的方法或屬性?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-find-the-methods-or-attributes-of-an-object
我的程式碼如何發現物件的名稱?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-my-code-discover-the-name-of-an-object
逗號運算子的優先級是什麼?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-s-up-with-the-comma-operator-s-precedence
是否有等效於 C 的 "?:" 三元運算子?https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-an-equivalent-of-c-s-ternary-operator
Is it possible to write obfuscated one-liners in Python?https://python.github.io/python-docs-zh-tw/faq/programming.html#is-it-possible-to-write-obfuscated-one-liners-in-python
函式參數串列中的斜線 (/) 是什麼意思?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-does-the-slash-in-the-parameter-list-of-a-function-mean
數字和字串https://python.github.io/python-docs-zh-tw/faq/programming.html#numbers-and-strings
如何指定十六進位和八進位整數?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-specify-hexadecimal-and-octal-integers
為什麼 -22 // 10 回傳 -3?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-does-22-10-return-3
How do I get int literal attribute instead of SyntaxError?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-get-int-literal-attribute-instead-of-syntaxerror
如何將字串轉換為數字?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-convert-a-string-to-a-number
如何將數字轉換為字串?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-convert-a-number-to-a-string
如何原地修改字串?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-modify-a-string-in-place
如何使用字串呼叫函式/方法?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-use-strings-to-call-functions-methods
Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-an-equivalent-to-perl-s-chomp-for-removing-trailing-newlines-from-strings
Is there a scanf() or sscanf() equivalent?https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-a-scanf-or-sscanf-equivalent
What does UnicodeDecodeError or UnicodeEncodeError error mean?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-does-unicodedecodeerror-or-unicodeencodeerror-error-mean
Can I end a raw string with an odd number of backslashes?https://python.github.io/python-docs-zh-tw/faq/programming.html#can-i-end-a-raw-string-with-an-odd-number-of-backslashes
效能https://python.github.io/python-docs-zh-tw/faq/programming.html#performance
我的程式太慢了。我該如何加快速度?https://python.github.io/python-docs-zh-tw/faq/programming.html#my-program-is-too-slow-how-do-i-speed-it-up
What is the most efficient way to concatenate many strings together?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together
序列(元組/串列)https://python.github.io/python-docs-zh-tw/faq/programming.html#sequences-tuples-lists
如何在元組和串列之間進行轉換?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-convert-between-tuples-and-lists
什麼是負索引?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-s-a-negative-index
How do I iterate over a sequence in reverse order?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-iterate-over-a-sequence-in-reverse-order
如何從串列中刪除重複項?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-remove-duplicates-from-a-list
如何從串列中刪除多個項目https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-remove-multiple-items-from-a-list
How do you make an array in Python?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-make-an-array-in-python
如何建立多維度串列?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-create-a-multidimensional-list
如何將方法或函式應用於物件序列?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-apply-a-method-or-function-to-a-sequence-of-objects
為什麼 a_tuple[i] += ['item'] 做加法時會引發例外?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works
我想做一個複雜的排序:你能用 Python 做一個 Schwartzian 變換嗎?https://python.github.io/python-docs-zh-tw/faq/programming.html#i-want-to-do-a-complicated-sort-can-you-do-a-schwartzian-transform-in-python
如何根據另一個串列中的值對一個串列進行排序?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-sort-one-list-by-values-from-another-list
物件https://python.github.io/python-docs-zh-tw/faq/programming.html#objects
什麼是類別 (class)?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-a-class
什麼是方法 (method)?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-a-method
什麼是 self?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-self
如何檢查物件是否是給定類別的實例或其子類別的實例?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-check-if-an-object-is-an-instance-of-a-given-class-or-of-a-subclass-of-it
什麼是委派 (delegation)?https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-delegation
How do I call a method defined in a base class from a derived class that extends it?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-call-a-method-defined-in-a-base-class-from-a-derived-class-that-extends-it
我可以如何組織我的程式碼以使得更改基底類別變的更容易?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-organize-my-code-to-make-it-easier-to-change-the-base-class
如何建立靜態類別資料和靜態類別方法?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-create-static-class-data-and-static-class-methods
如何在 Python 中多載 (overload) 建構函式(或方法)?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-overload-constructors-or-methods-in-python
我嘗試使用 __spam,但收到有關 _SomeClassName__spam 的錯誤。https://python.github.io/python-docs-zh-tw/faq/programming.html#i-try-to-use-spam-and-i-get-an-error-about-someclassname-spam
我的類別定義了 __del__ 但是當我刪除物件時它沒有被呼叫。https://python.github.io/python-docs-zh-tw/faq/programming.html#my-class-defines-del-but-it-is-not-called-when-i-delete-the-object
我該如何取得給定類別的所有實例的串列?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-get-a-list-of-all-instances-of-a-given-class
為什麼 id() 的結果看起來不唯一?https://python.github.io/python-docs-zh-tw/faq/programming.html#why-does-the-result-of-id-appear-to-be-not-unique
我什麼時候可以依靠 is 運算子進行識別性測試?https://python.github.io/python-docs-zh-tw/faq/programming.html#when-can-i-rely-on-identity-tests-with-the-is-operator
子類別如何控制不可變實例中儲存的資料?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-a-subclass-control-what-data-is-stored-in-an-immutable-instance
如何快取方法呼叫?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-cache-method-calls
模組https://python.github.io/python-docs-zh-tw/faq/programming.html#modules
如何建立 .pyc 檔案?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-create-a-pyc-file
如何找到目前模組名稱?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-find-the-current-module-name
要怎樣才能擁有相互引入的模組?https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-have-modules-that-mutually-import-each-other
__import__('x.y.z') 回傳 ,那我怎麼得到 z?https://python.github.io/python-docs-zh-tw/faq/programming.html#import-x-y-z-returns-module-x-how-do-i-get-z
當我編輯需要引入的模組並重新引入它時,更動沒有反應出來。為什麼會這樣?https://python.github.io/python-docs-zh-tw/faq/programming.html#when-i-edit-an-imported-module-and-reimport-it-the-changes-don-t-show-up-why-does-this-happen
常見問題https://python.github.io/python-docs-zh-tw/faq/programming.html#id4
https://python.github.io/python-docs-zh-tw/faq/programming.html#general-questions
是否有可以使用在程式碼階段,具有中斷點,步驟執行等功能的除錯器?https://python.github.io/python-docs-zh-tw/faq/programming.html#id5
https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-a-source-code-level-debugger-with-breakpoints-single-stepping-etc
breakpoint()https://python.github.io/python-docs-zh-tw/library/functions.html#breakpoint
記錄在函式庫參考手冊https://python.github.io/python-docs-zh-tw/library/pdb.html#module-pdb
Tools/scripts/idle3https://github.com/python/cpython/blob/main/Tools/scripts/idle3
pywin32https://github.com/mhammond/pywin32
ActivePythonhttps://www.activestate.com/products/python/
Erichttps://eric-ide.python-projects.org/
trepan3khttps://github.com/rocky/python3-trepan/
Visual Studio Codehttps://code.visualstudio.com/
Wing IDEhttps://wingware.com/
Komodo IDEhttps://www.activestate.com/products/komodo-ide/
PyCharmhttps://www.jetbrains.com/pycharm/
有沒有工具能夠幫忙找 bug 或執行靜態分析?https://python.github.io/python-docs-zh-tw/faq/programming.html#id6
https://python.github.io/python-docs-zh-tw/faq/programming.html#are-there-tools-to-help-find-bugs-or-perform-static-analysis
Pylinthttps://pylint.pycqa.org/en/latest/index.html
Pyflakeshttps://github.com/PyCQA/pyflakes
Mypyhttps://mypy-lang.org/
Pyrehttps://pyre-check.org/
Pytypehttps://github.com/google/pytype
如何從 Python 腳本建立獨立的二進位檔案?https://python.github.io/python-docs-zh-tw/faq/programming.html#id7
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-create-a-stand-alone-binary-from-a-python-script
Tools/freezehttps://github.com/python/cpython/tree/main/Tools/freeze
Nuitkahttps://nuitka.net/
PyInstallerhttps://pyinstaller.org/
PyOxidizerhttps://pyoxidizer.readthedocs.io/en/stable/
cx_Freezehttps://marcelotduarte.github.io/cx_Freeze/
py2apphttps://github.com/ronaldoussoren/py2app
py2exehttps://www.py2exe.org/
Python 程式碼是否有編碼標準或風格指南?https://python.github.io/python-docs-zh-tw/faq/programming.html#id8
https://python.github.io/python-docs-zh-tw/faq/programming.html#are-there-coding-standards-or-a-style-guide-for-python-programs
PEP 8https://peps.python.org/pep-0008/
核心語言https://python.github.io/python-docs-zh-tw/faq/programming.html#id9
https://python.github.io/python-docs-zh-tw/faq/programming.html#core-language
為什麼當變數有值時,我仍得到錯誤訊息 UnboundLocalError?https://python.github.io/python-docs-zh-tw/faq/programming.html#id10
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value
UnboundLocalErrorhttps://python.github.io/python-docs-zh-tw/library/exceptions.html#UnboundLocalError
nonlocalhttps://python.github.io/python-docs-zh-tw/reference/simple_stmts.html#nonlocal
Python 的區域變數和全域變數有什麼規則?https://python.github.io/python-docs-zh-tw/faq/programming.html#id11
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-are-the-rules-for-local-and-global-variables-in-python
globalhttps://python.github.io/python-docs-zh-tw/reference/simple_stmts.html#global
為什麼以不同的值在迴圈中定義的 lambda 都回傳相同的結果?https://python.github.io/python-docs-zh-tw/faq/programming.html#id12
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result
如何跨模組共享全域變數?https://python.github.io/python-docs-zh-tw/faq/programming.html#id13
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-share-global-variables-across-modules
在模組中使用 import 的「最佳實踐」有哪些?https://python.github.io/python-docs-zh-tw/faq/programming.html#id14
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-are-the-best-practices-for-using-import-in-a-module
syshttps://python.github.io/python-docs-zh-tw/library/sys.html#module-sys
oshttps://python.github.io/python-docs-zh-tw/library/os.html#module-os
argparsehttps://python.github.io/python-docs-zh-tw/library/argparse.html#module-argparse
rehttps://python.github.io/python-docs-zh-tw/library/re.html#module-re
sys.moduleshttps://python.github.io/python-docs-zh-tw/library/sys.html#sys.modules
為什麼物件之間共享預設值?https://python.github.io/python-docs-zh-tw/faq/programming.html#id15
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-are-default-values-shared-between-objects
How can I pass optional or keyword parameters from one function to another?https://python.github.io/python-docs-zh-tw/faq/programming.html#id16
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-pass-optional-or-keyword-parameters-from-one-function-to-another
引數 (arguments) 和參數 (parameters) 有什麼區別?https://python.github.io/python-docs-zh-tw/faq/programming.html#id17
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-the-difference-between-arguments-and-parameters
參數https://python.github.io/python-docs-zh-tw/glossary.html#term-parameter
引數https://python.github.io/python-docs-zh-tw/glossary.html#term-argument
引數種類https://python.github.io/python-docs-zh-tw/glossary.html#term-parameter
為什麼更改串列 'y' 也會更改串列 'x'?https://python.github.io/python-docs-zh-tw/faq/programming.html#id18
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-did-changing-list-y-also-change-list-x
mutablehttps://python.github.io/python-docs-zh-tw/glossary.html#term-mutable
append()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#sequence.append
immutablehttps://python.github.io/python-docs-zh-tw/glossary.html#term-immutable
sorted(y)https://python.github.io/python-docs-zh-tw/library/functions.html#sorted
listhttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#list
dicthttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#dict
sethttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#set
strhttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#str
inthttps://python.github.io/python-docs-zh-tw/library/functions.html#int
tuplehttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#tuple
ishttps://python.github.io/python-docs-zh-tw/reference/expressions.html#is
id()https://python.github.io/python-docs-zh-tw/library/functions.html#id
如何編寫帶有輸出參數的函式(透過傳參照呼叫 (call by reference))?https://python.github.io/python-docs-zh-tw/faq/programming.html#id19
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-write-a-function-with-output-parameters-call-by-reference
你如何在 Python 中建立高階函式?https://python.github.io/python-docs-zh-tw/faq/programming.html#id20
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-make-a-higher-order-function-in-python
如何在 Python 中複製物件?https://python.github.io/python-docs-zh-tw/faq/programming.html#id21
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-copy-an-object-in-python
copy.copy()https://python.github.io/python-docs-zh-tw/library/copy.html#copy.copy
copy.deepcopy()https://python.github.io/python-docs-zh-tw/library/copy.html#copy.deepcopy
copy()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#dict.copy
如何找到物件的方法或屬性?https://python.github.io/python-docs-zh-tw/faq/programming.html#id22
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-find-the-methods-or-attributes-of-an-object
dir(x)https://python.github.io/python-docs-zh-tw/library/functions.html#dir
我的程式碼如何發現物件的名稱?https://python.github.io/python-docs-zh-tw/faq/programming.html#id23
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-my-code-discover-the-name-of-an-object
逗號運算子的優先級是什麼?https://python.github.io/python-docs-zh-tw/faq/programming.html#id24
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-s-up-with-the-comma-operator-s-precedence
是否有等效於 C 的 "?:" 三元運算子?https://python.github.io/python-docs-zh-tw/faq/programming.html#id25
https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-an-equivalent-of-c-s-ternary-operator
Is it possible to write obfuscated one-liners in Python?https://python.github.io/python-docs-zh-tw/faq/programming.html#id26
https://python.github.io/python-docs-zh-tw/faq/programming.html#is-it-possible-to-write-obfuscated-one-liners-in-python
lambdahttps://python.github.io/python-docs-zh-tw/reference/expressions.html#lambda
函式參數串列中的斜線 (/) 是什麼意思?https://python.github.io/python-docs-zh-tw/faq/programming.html#id27
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-does-the-slash-in-the-parameter-list-of-a-function-mean
divmod()https://python.github.io/python-docs-zh-tw/library/functions.html#divmod
divmod()https://python.github.io/python-docs-zh-tw/library/functions.html#divmod
數字和字串https://python.github.io/python-docs-zh-tw/faq/programming.html#id28
https://python.github.io/python-docs-zh-tw/faq/programming.html#numbers-and-strings
如何指定十六進位和八進位整數?https://python.github.io/python-docs-zh-tw/faq/programming.html#id29
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-specify-hexadecimal-and-octal-integers
為什麼 -22 // 10 回傳 -3?https://python.github.io/python-docs-zh-tw/faq/programming.html#id30
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-does-22-10-return-3
How do I get int literal attribute instead of SyntaxError?https://python.github.io/python-docs-zh-tw/faq/programming.html#id31
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-get-int-literal-attribute-instead-of-syntaxerror
SyntaxErrorhttps://python.github.io/python-docs-zh-tw/library/exceptions.html#SyntaxError
如何將字串轉換為數字?https://python.github.io/python-docs-zh-tw/faq/programming.html#id32
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-convert-a-string-to-a-number
int()https://python.github.io/python-docs-zh-tw/library/functions.html#int
float()https://python.github.io/python-docs-zh-tw/library/functions.html#float
ValueErrorhttps://python.github.io/python-docs-zh-tw/library/exceptions.html#ValueError
eval()https://python.github.io/python-docs-zh-tw/library/functions.html#eval
eval()https://python.github.io/python-docs-zh-tw/library/functions.html#eval
eval()https://python.github.io/python-docs-zh-tw/library/functions.html#eval
如何將數字轉換為字串?https://python.github.io/python-docs-zh-tw/faq/programming.html#id33
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-convert-a-number-to-a-string
str()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#str
hex()https://python.github.io/python-docs-zh-tw/library/functions.html#hex
oct()https://python.github.io/python-docs-zh-tw/library/functions.html#oct
f-string(f 字串)https://python.github.io/python-docs-zh-tw/reference/lexical_analysis.html#f-strings
格式化文字語法https://python.github.io/python-docs-zh-tw/library/string.html#formatstrings
如何原地修改字串?https://python.github.io/python-docs-zh-tw/faq/programming.html#id34
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-modify-a-string-in-place
io.StringIOhttps://python.github.io/python-docs-zh-tw/library/io.html#io.StringIO
arrayhttps://python.github.io/python-docs-zh-tw/library/array.html#module-array
如何使用字串呼叫函式/方法?https://python.github.io/python-docs-zh-tw/faq/programming.html#id35
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-use-strings-to-call-functions-methods
getattr()https://python.github.io/python-docs-zh-tw/library/functions.html#getattr
getattr()https://python.github.io/python-docs-zh-tw/library/functions.html#getattr
locals()https://python.github.io/python-docs-zh-tw/library/functions.html#locals
Is there an equivalent to Perl's chomp() for removing trailing newlines from strings?https://python.github.io/python-docs-zh-tw/faq/programming.html#id36
https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-an-equivalent-to-perl-s-chomp-for-removing-trailing-newlines-from-strings
Is there a scanf() or sscanf() equivalent?https://python.github.io/python-docs-zh-tw/faq/programming.html#id37
https://python.github.io/python-docs-zh-tw/faq/programming.html#is-there-a-scanf-or-sscanf-equivalent
split()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#str.split
int()https://python.github.io/python-docs-zh-tw/library/functions.html#int
float()https://python.github.io/python-docs-zh-tw/library/functions.html#float
What does UnicodeDecodeError or UnicodeEncodeError error mean?https://python.github.io/python-docs-zh-tw/faq/programming.html#id38
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-does-unicodedecodeerror-or-unicodeencodeerror-error-mean
Unicode HOWTOhttps://python.github.io/python-docs-zh-tw/howto/unicode.html#unicode-howto
Can I end a raw string with an odd number of backslashes?https://python.github.io/python-docs-zh-tw/faq/programming.html#id39
https://python.github.io/python-docs-zh-tw/faq/programming.html#can-i-end-a-raw-string-with-an-odd-number-of-backslashes
os.path.join()https://python.github.io/python-docs-zh-tw/library/os.path.html#os.path.join
language referencehttps://python.github.io/python-docs-zh-tw/reference/lexical_analysis.html#strings
效能https://python.github.io/python-docs-zh-tw/faq/programming.html#id40
https://python.github.io/python-docs-zh-tw/faq/programming.html#performance
我的程式太慢了。我該如何加快速度?https://python.github.io/python-docs-zh-tw/faq/programming.html#id41
https://python.github.io/python-docs-zh-tw/faq/programming.html#my-program-is-too-slow-how-do-i-speed-it-up
CPythonhttps://python.github.io/python-docs-zh-tw/glossary.html#term-CPython
profilehttps://python.github.io/python-docs-zh-tw/library/profile.html#module-profile
timeithttps://python.github.io/python-docs-zh-tw/library/timeit.html#module-timeit
內建型別https://python.github.io/python-docs-zh-tw/library/stdtypes.html#bltin-types
collectionshttps://python.github.io/python-docs-zh-tw/library/collections.html#module-collections
list.sort()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#list.sort
sorted()https://python.github.io/python-docs-zh-tw/library/functions.html#sorted
排序技法https://python.github.io/python-docs-zh-tw/howto/sorting.html#sortinghowto
Cythonhttps://cython.org
write a C extension modulehttps://python.github.io/python-docs-zh-tw/extending/index.html#extending-index
效能改進小提示https://wiki.python.org/moin/PythonSpeed/PerformanceTips
What is the most efficient way to concatenate many strings together?https://python.github.io/python-docs-zh-tw/faq/programming.html#id42
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-the-most-efficient-way-to-concatenate-many-strings-together
strhttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#str
byteshttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#bytes
strhttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#str
str.join()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#str.join
io.StringIOhttps://python.github.io/python-docs-zh-tw/library/io.html#io.StringIO
byteshttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#bytes
bytearrayhttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#bytearray
序列(元組/串列)https://python.github.io/python-docs-zh-tw/faq/programming.html#id43
https://python.github.io/python-docs-zh-tw/faq/programming.html#sequences-tuples-lists
如何在元組和串列之間進行轉換?https://python.github.io/python-docs-zh-tw/faq/programming.html#id44
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-convert-between-tuples-and-lists
tuple()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#tuple
什麼是負索引?https://python.github.io/python-docs-zh-tw/faq/programming.html#id45
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-s-a-negative-index
How do I iterate over a sequence in reverse order?https://python.github.io/python-docs-zh-tw/faq/programming.html#id46
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-iterate-over-a-sequence-in-reverse-order
reversed()https://python.github.io/python-docs-zh-tw/library/functions.html#reversed
如何從串列中刪除重複項?https://python.github.io/python-docs-zh-tw/faq/programming.html#id47
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-remove-duplicates-from-a-list
https://code.activestate.com/recipes/52560/https://code.activestate.com/recipes/52560/
hashablehttps://python.github.io/python-docs-zh-tw/glossary.html#term-hashable
如何從串列中刪除多個項目https://python.github.io/python-docs-zh-tw/faq/programming.html#id48
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-remove-multiple-items-from-a-list
How do you make an array in Python?https://python.github.io/python-docs-zh-tw/faq/programming.html#id49
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-you-make-an-array-in-python
NumPyhttps://numpy.org/
如何建立多維度串列?https://python.github.io/python-docs-zh-tw/faq/programming.html#id50
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-create-a-multidimensional-list
NumPyhttps://numpy.org/
如何將方法或函式應用於物件序列?https://python.github.io/python-docs-zh-tw/faq/programming.html#id51
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-apply-a-method-or-function-to-a-sequence-of-objects
list comprehensionhttps://python.github.io/python-docs-zh-tw/glossary.html#term-list-comprehension
forhttps://python.github.io/python-docs-zh-tw/reference/compound_stmts.html#for
為什麼 a_tuple[i] += ['item'] 做加法時會引發例外?https://python.github.io/python-docs-zh-tw/faq/programming.html#id52
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-does-a-tuple-i-item-raise-an-exception-when-the-addition-works
__iadd__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__iadd__
extend()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#sequence.extend
list.extend()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#list.extend
我想做一個複雜的排序:你能用 Python 做一個 Schwartzian 變換嗎?https://python.github.io/python-docs-zh-tw/faq/programming.html#id53
https://python.github.io/python-docs-zh-tw/faq/programming.html#i-want-to-do-a-complicated-sort-can-you-do-a-schwartzian-transform-in-python
list.sort()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#list.sort
如何根據另一個串列中的值對一個串列進行排序?https://python.github.io/python-docs-zh-tw/faq/programming.html#id54
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-sort-one-list-by-values-from-another-list
物件https://python.github.io/python-docs-zh-tw/faq/programming.html#id55
https://python.github.io/python-docs-zh-tw/faq/programming.html#objects
什麼是類別 (class)?https://python.github.io/python-docs-zh-tw/faq/programming.html#id56
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-a-class
什麼是方法 (method)?https://python.github.io/python-docs-zh-tw/faq/programming.html#id57
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-a-method
什麼是 self?https://python.github.io/python-docs-zh-tw/faq/programming.html#id58
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-self
為何「self」在方法 (method) 定義和呼叫時一定要明確使用?https://python.github.io/python-docs-zh-tw/faq/design.html#why-self
如何檢查物件是否是給定類別的實例或其子類別的實例?https://python.github.io/python-docs-zh-tw/faq/programming.html#id59
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-check-if-an-object-is-an-instance-of-a-given-class-or-of-a-subclass-of-it
isinstance(obj, cls)https://python.github.io/python-docs-zh-tw/library/functions.html#isinstance
isinstance()https://python.github.io/python-docs-zh-tw/library/functions.html#isinstance
抽象基底類別 (abstract base class)https://python.github.io/python-docs-zh-tw/glossary.html#term-abstract-base-class
MROhttps://python.github.io/python-docs-zh-tw/glossary.html#term-MRO
isinstance()https://python.github.io/python-docs-zh-tw/library/functions.html#isinstance
什麼是委派 (delegation)?https://python.github.io/python-docs-zh-tw/faq/programming.html#id60
https://python.github.io/python-docs-zh-tw/faq/programming.html#what-is-delegation
__getattr__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__getattr__
the language referencehttps://python.github.io/python-docs-zh-tw/reference/datamodel.html#attribute-access
__setattr__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__setattr__
__setattr__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__setattr__
self.__dict__https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__dict__
How do I call a method defined in a base class from a derived class that extends it?https://python.github.io/python-docs-zh-tw/faq/programming.html#id61
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-call-a-method-defined-in-a-base-class-from-a-derived-class-that-extends-it
super()https://python.github.io/python-docs-zh-tw/library/functions.html#super
super()https://python.github.io/python-docs-zh-tw/library/functions.html#super
method resolution orderhttps://python.github.io/python-docs-zh-tw/glossary.html#term-method-resolution-order
我可以如何組織我的程式碼以使得更改基底類別變的更容易?https://python.github.io/python-docs-zh-tw/faq/programming.html#id62
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-organize-my-code-to-make-it-easier-to-change-the-base-class
如何建立靜態類別資料和靜態類別方法?https://python.github.io/python-docs-zh-tw/faq/programming.html#id63
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-create-static-class-data-and-static-class-methods
如何在 Python 中多載 (overload) 建構函式(或方法)?https://python.github.io/python-docs-zh-tw/faq/programming.html#id64
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-overload-constructors-or-methods-in-python
我嘗試使用 __spam,但收到有關 _SomeClassName__spam 的錯誤。https://python.github.io/python-docs-zh-tw/faq/programming.html#id65
https://python.github.io/python-docs-zh-tw/faq/programming.html#i-try-to-use-spam-and-i-get-an-error-about-someclassname-spam
private name mangling specificationshttps://python.github.io/python-docs-zh-tw/reference/expressions.html#private-name-mangling
我的類別定義了 __del__ 但是當我刪除物件時它沒有被呼叫。https://python.github.io/python-docs-zh-tw/faq/programming.html#id66
https://python.github.io/python-docs-zh-tw/faq/programming.html#my-class-defines-del-but-it-is-not-called-when-i-delete-the-object
delhttps://python.github.io/python-docs-zh-tw/reference/simple_stmts.html#del
__del__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__del__
gc.collect()https://python.github.io/python-docs-zh-tw/library/gc.html#gc.collect
weakrefhttps://python.github.io/python-docs-zh-tw/library/weakref.html#module-weakref
sys.stderrhttps://python.github.io/python-docs-zh-tw/library/sys.html#sys.stderr
我該如何取得給定類別的所有實例的串列?https://python.github.io/python-docs-zh-tw/faq/programming.html#id67
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-get-a-list-of-all-instances-of-a-given-class
為什麼 id() 的結果看起來不唯一?https://python.github.io/python-docs-zh-tw/faq/programming.html#id68
https://python.github.io/python-docs-zh-tw/faq/programming.html#why-does-the-result-of-id-appear-to-be-not-unique
id()https://python.github.io/python-docs-zh-tw/library/functions.html#id
我什麼時候可以依靠 is 運算子進行識別性測試?https://python.github.io/python-docs-zh-tw/faq/programming.html#id69
https://python.github.io/python-docs-zh-tw/faq/programming.html#when-can-i-rely-on-identity-tests-with-the-is-operator
inthttps://python.github.io/python-docs-zh-tw/library/functions.html#int
strhttps://python.github.io/python-docs-zh-tw/library/stdtypes.html#str
PEP 8https://peps.python.org/pep-0008/
dict.pop()https://python.github.io/python-docs-zh-tw/library/stdtypes.html#dict.pop
子類別如何控制不可變實例中儲存的資料?https://python.github.io/python-docs-zh-tw/faq/programming.html#id70
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-a-subclass-control-what-data-is-stored-in-an-immutable-instance
__new__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__new__
__init__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__init__
如何快取方法呼叫?https://python.github.io/python-docs-zh-tw/faq/programming.html#id71
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-cache-method-calls
functools.cached_property()https://python.github.io/python-docs-zh-tw/library/functools.html#functools.cached_property
functools.lru_cache()https://python.github.io/python-docs-zh-tw/library/functools.html#functools.lru_cache
可雜湊https://python.github.io/python-docs-zh-tw/glossary.html#term-hashable
__eq__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__eq__
__hash__()https://python.github.io/python-docs-zh-tw/reference/datamodel.html#object.__hash__
模組https://python.github.io/python-docs-zh-tw/faq/programming.html#id72
https://python.github.io/python-docs-zh-tw/faq/programming.html#modules
如何建立 .pyc 檔案?https://python.github.io/python-docs-zh-tw/faq/programming.html#id73
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-create-a-pyc-file
PEP 3147https://peps.python.org/pep-3147/
PYTHONDONTWRITEBYTECODEhttps://python.github.io/python-docs-zh-tw/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE
py_compilehttps://python.github.io/python-docs-zh-tw/library/py_compile.html#module-py_compile
compileallhttps://python.github.io/python-docs-zh-tw/library/compileall.html#module-compileall
py_compilehttps://python.github.io/python-docs-zh-tw/library/py_compile.html#module-py_compile
compileallhttps://python.github.io/python-docs-zh-tw/library/compileall.html#module-compileall
如何找到目前模組名稱?https://python.github.io/python-docs-zh-tw/faq/programming.html#id74
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-do-i-find-the-current-module-name
要怎樣才能擁有相互引入的模組?https://python.github.io/python-docs-zh-tw/faq/programming.html#id75
https://python.github.io/python-docs-zh-tw/faq/programming.html#how-can-i-have-modules-that-mutually-import-each-other
__import__('x.y.z') 回傳 ,那我怎麼得到 z?https://python.github.io/python-docs-zh-tw/faq/programming.html#id76
https://python.github.io/python-docs-zh-tw/faq/programming.html#import-x-y-z-returns-module-x-how-do-i-get-z
import_module()https://python.github.io/python-docs-zh-tw/library/importlib.html#importlib.import_module
importlibhttps://python.github.io/python-docs-zh-tw/library/importlib.html#module-importlib
當我編輯需要引入的模組並重新引入它時,更動沒有反應出來。為什麼會這樣?https://python.github.io/python-docs-zh-tw/faq/programming.html#id77
https://python.github.io/python-docs-zh-tw/faq/programming.html#when-i-edit-an-imported-module-and-reimport-it-the-changes-don-t-show-up-why-does-this-happen
目錄https://python.github.io/python-docs-zh-tw/contents.html
程式開發常見問答集https://python.github.io/python-docs-zh-tw/faq/programming.html
常見問題https://python.github.io/python-docs-zh-tw/faq/programming.html#general-questions
核心語言https://python.github.io/python-docs-zh-tw/faq/programming.html#core-language
數字和字串https://python.github.io/python-docs-zh-tw/faq/programming.html#numbers-and-strings
效能https://python.github.io/python-docs-zh-tw/faq/programming.html#performance
序列(元組/串列)https://python.github.io/python-docs-zh-tw/faq/programming.html#sequences-tuples-lists
物件https://python.github.io/python-docs-zh-tw/faq/programming.html#objects
模組https://python.github.io/python-docs-zh-tw/faq/programming.html#modules
一般的 Python 常見問答集https://python.github.io/python-docs-zh-tw/faq/general.html
設計和歷史常見問答集https://python.github.io/python-docs-zh-tw/faq/design.html
回報錯誤https://python.github.io/python-docs-zh-tw/bugs.html
顯示原始碼 https://github.com/python/cpython/blob/main/Doc/faq/programming.rst?plain=1
索引https://python.github.io/python-docs-zh-tw/genindex.html
模組https://python.github.io/python-docs-zh-tw/py-modindex.html
下一頁https://python.github.io/python-docs-zh-tw/faq/design.html
上一頁https://python.github.io/python-docs-zh-tw/faq/general.html
Pythonhttps://www.python.org/
3.14.0 Documentationhttps://python.github.io/python-docs-zh-tw/index.html
Python 常見問題https://python.github.io/python-docs-zh-tw/faq/index.html
程式開發常見問答集https://python.github.io/python-docs-zh-tw/faq/programming.html
版權所有https://python.github.io/python-docs-zh-tw/copyright.html
歷史與授權條款https://python.github.io/license.html
敬請捐贈。https://www.python.org/psf/donations/
發現 bughttps://python.github.io/bugs.html
Sphinxhttps://www.sphinx-doc.org/

Viewport: width=device-width, initial-scale=1.0


URLs of crawlers that visited me.