這是歷史版本頁面 — 看 Python (64-bit) 最新版本

想學寫程式或自動化工作,Python 能幫你做什麼

Python (64-bit) 軟體圖示 Python (64-bit) 3.11.2 (64-bit) 資料更新 2023-02-09 閱讀約 6 分鐘

你手上有一堆重複的檔案要整理,或是一份好幾萬列的資料表,Excel 開起來就卡住,你想找個方法把這些事情交給電腦自己跑。又或者,你一直想學寫程式,但打開教學文章看到一堆看不懂的專有名詞,不確定自己到底該從哪裡開始,也不確定學了之後到底能拿來做什麼。

你大概聽過「寫程式可以解決很多問題」,但真的打開編輯器,卻不知道第一行要打什麼。上網找答案,有人說要先學 C、有人說要學 JavaScript,還有人說直接學 Python 最快。你需要的不是更多選擇,而是一個能讓你實際動手、做完一件小事的工具,然後從那裡慢慢長出能力。

01Python 到底能拿來做什麼?

官方說明指出,Python 是動態物件導向程式語言,可用於多種軟體開發,包括網頁開發、資料分析、科學計算、人工智慧、機器學習和自動化。標準函式庫支援 HTML、XML、JSON、Email 處理、FTP、IMAP 等網路協定,還有 pip 套件管理器可安裝第三方模組。具體能做什麼,取決於你安裝了哪些函式庫。

02它學起來會不會很難?

官方資料說它的語法簡潔直觀,縮排結構強制程式碼可讀性,初學者能在幾天內學會基本概念。動態型別讓變數不需要宣告型別,加快開發速度。但這不代表完全沒有學習曲線,物件導向、例外處理、套件管理這些概念還是需要時間熟悉。如果你完全沒寫過程式,建議先從官方教學文件開始。

03它能寫網頁或手機App嗎?

網頁可以。官方資料提到 Django 和 Flask 兩個網頁框架,能簡化網頁開發並建立可擴充的應用程式。手機 App 方面,官方資料沒有提到相關框架或工具,需要自行確認是否有對應的解決方案。如果你主要目標是手機 App,可能需要考慮其他語言或工具。

04它能處理大量資料或做數據分析嗎?

可以。官方資料列出 NumPy 做科學計算、Pandas 做資料操作、Matplotlib 做資料視覺化,這些是資料分析常用的函式庫。TensorFlow 和 PyTorch 則用於機器學習。這些函式庫能大幅加速開發,不用從零開始寫演算法。但要注意,這些都是第三方套件,需要另外安裝。

05它能自動化重複性的工作嗎?

可以。官方資料提到 Python 可用於自動化,且標準函式庫支援多種網路協定,例如用 FTP 或 IMAP 處理檔案傳輸和郵件。配合第三方套件如 Requests(HTTP 客戶端)、BeautifulSoup(HTML 解析),可以寫腳本自動抓取網頁資料或處理檔案。具體能自動化什麼,取決於你安裝的套件。

06完全沒寫過程式的人適合學嗎?

官方資料說 Python 常被用作高中和大學的入門程式語言,因為語法簡單、容易學習。它強調程式碼可讀性,縮排結構能減少語法錯誤。但「適合初學者」不代表不用花時間,還是需要投入時間練習。如果你完全沒接觸過程式,可以先從官方教學文件開始。

07我已經會寫C或Java,還需要學它嗎?

官方資料說 Python 可以與 C、C++、Java 整合,也能嵌入其他應用程式當作腳本介面。如果你已經有程式基礎,Python 的語法會更容易上手,而且可以用來快速開發原型。但如果你現有的語言已經能解決問題,就不一定要換。Python 的優勢在於開發速度和生態系,不是取代其他語言。

08我的電腦是Windows 7,可以用嗎?

要注意。官方資料明確說 Python 3.9 以上的版本不能在 Windows 7 或更早的系統上執行。如果你還在用 Windows 7,只能安裝 3.8 或更早的版本,但那些版本可能不再獲得更新。建議先確認你的系統版本,再決定要安裝哪個版本。Windows 8、10、11 則沒有這個限制。

09我不喜歡打指令,只想要圖形介面,適合嗎?

官方資料說 Python 本身是命令列語言,沒有專屬的圖形使用者介面。但可以搭配 PyCharm、Visual Studio Code、Atom、Jupyter Notebook 等 IDE 或編輯器,這些工具提供程式碼自動完成、語法標示、除錯功能。如果你完全不想碰指令列,還是需要透過這些工具來操作。

10我想寫一個執行速度很快的程式,適合嗎?

官方資料沒有提到 Python 的執行效能。它是直譯式語言,通常比編譯式語言慢,但資料沒有提供具體數據。如果你的程式需要極高效能,可能需要考慮其他語言,或把效能關鍵的部分用 C/C++ 撰寫再整合。這部分需要你自己測試評估。

11我想開發手機App,適合嗎?

官方資料沒有提到手機 App 開發的相關框架或工具。Python 主要用於網頁、資料分析、科學計算、自動化等領域。如果你要開發手機 App,可能需要找其他語言或工具,或確認是否有第三方套件能達成。資料沒有這方面的資訊,建議先確認你的需求再決定。

12它需要付費嗎?

官方資料說 Python 64-bit 採用 OSI 認可的開源授權,可以免費使用,包括商業產品。不需要付費購買授權。但如果你要使用某些第三方套件,那些套件可能有自己的授權條款,需要個別確認。官方網站提供各作業系統的安裝檔,下載和安裝都是免費的。

下載與官方連結

前往官方網站 下載 Python (64-bit)

python-3.11.2.amd64.exe · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

Core and Builtins:
-Fix the defs and kwdefs arguments to PyEval_EvalCodeEx() and a reference leak in that function
- Fix wrong lineno in exception message on continue or break which are not in a loop. Patch by Dong-hee Na
- Fix is_normalized() to properly handle the UCD 3.2.0 cases. Patch by Dong-hee Na
- Fix a possible memory leak in the parser when raising MemoryError. Patch by Pablo Galindo
- Fix potential memory underallocation issue for instances of int subclasses with value zero
- Fixed segfault in property.getter/setter/deleter that occurred when a property subclass overrode the __new__ method to return a non-property instance
- Fix race while iterating over thread states in clearing threading.local. Patch by Kumar Aditya
- Fix misleading default value in input()’s __text_signature__
- Fix int.__sizeof__() calculation to include the 1 element ob_digit array for 0 and False
- Update the native_thread_id field of PyThreadState after fork
- Fix incorrect result and delay in socket.getfqdn(). Patch by Dominic Socular
-Initialize frame->previous in frameobject.c to fix a segmentation fault when accessing frames created by PyFrame_New()
- Honor existing errors obtained when searching for mismatching parentheses in the tokenizer. Patch by Pablo Galindo
- bpo-32782: ctypes arrays of length 0 now report a correct itemsize when a memoryview is constructed from them, rather than always giving a value of 0.

Library:
- [Enum] - fix psuedo-flag creation
- Fix regression when passing None as second or third argument to FutureIter.throw.
- Avoid potential unexpected freeaddrinfo call (double free) in socket when when a libc getaddrinfo() implementation leaves garbage in an output pointer when returning an error. Original patch by Sergey G. Brester.
- Remove unused references to TimerHandle in asyncio.base_events.BaseEventLoop._add_callback.
- Make zipfile.Path.open() and zipfile.Path.read_text() also accept encoding as a positional argument. This was the behavior in Python 3.9 and earlier. 3.10 introduced a regression where supplying it as a positional argument would lead to a TypeError.
- Fix typing.get_type_hints() on '*tuple[...]' and *tuple[...]. It must not drop the Unpack part.
- Fix a Windows asyncio bug with named pipes where a client doing os.stat() on the pipe would cause an error in the server that disabled serving future requests
- Modify random.choice() implementation to once again work with NumPy arrays
-Avoid RecursionError on repr if a dataclass field definition has a cyclic reference
- pass encoding kwarg to subprocess in platform
- Fix crash in pyexpat by statically allocating PyExpat_CAPI capsule
- Fix unittest.mock.Mock not respecting the spec for attribute names prefixed with assert
-Fix asyncio.open_connection() to skip binding to local addresses of different family. Patch by Kumar Aditya
- Fix the interaction of unittest.mock.seal() with unittest.mock.AsyncMock
- http.server now checks that an index page is actually a regular file before trying to serve it. This avoids issues with directories named index.html.
- Remove any deprecation warnings in asyncio.get_event_loop(). They are deferred to Python 3.12.
-Fix handling of partial and invalid UNC drives in ntpath.splitdrive(), and in ntpath.normpath() on non-Windows systems. Paths such as ‘server’ and ‘’ are now considered by splitdrive() to contain only a drive, and consequently are not modified by normpath() on non-Windows systems. The behaviour of normpath() on Windows systems is unaffected, as native OS APIs are used. Patch by Eryk Sun, with contributions by Barney Gale.
-Fix crash when creating an instance of _ctypes.CField.
-Fix a reference undercounting issue in ctypes.Structure with from_param() results larger than a C pointer
- Fix regression in asyncio where a subprocess would sometimes lose data received from pipe
- Fix tuple subclasses being cast to tuple when used as enum values
-Update HTTPError to be initialized properly, even if the fp is None. Patch by Dong-hee Na
-Fix inspect.getsource() handling of decorator calls with nested parentheses
-Fix .save() method for LWPCookieJar and MozillaCookieJar: saved file was not truncated on repeated save
-Fix doctest failure on types.MethodWrapperType in modules
-Fix double-free bug in Argument Clinic str_converter by extracting memory clean up to a new post_parsing section
-Fix refcount error when arguments are packed to tuple in Argument Clinic
-Several improvements to inspect.signature()’s handling of __text_signature. - Fixes a case where inspect.signature() dropped parameters - Fixes a case where inspect.signature() raised tokenize.TokenError - Allows inspect.signature() to understand defaults involving binary operations of constants - inspect.signature() is documented as only raising TypeError or ValueError, but sometimes raised RuntimeError. These cases now raise ValueError - Removed a dead code path
-Fix a 3.11 regression in asynccontextmanager(), which caused it to propagate exceptions with incorrect tracebacks and fix a 3.11 regression in contextmanager(), which caused it to propagate exceptions with incorrect tracebacks for StopIteration.
- bpo-44817: Ignore WinError 53 (ERROR_BAD_NETPATH), 65 (ERROR_NETWORK_ACCESS_DENIED) and 161 (ERROR_BAD_PATHNAME) when using ntpath.realpath()
- bpo-40447: Accept os.PathLike (such as pathlib.Path) in the stripdir arguments of compileall.compile_file() and compileall.compile_dir()
- bpo-36880: Fix a reference counting issue when a ctypes callback with return type py_object returns None, which could cause crashes

Documentation:
- Document existing attr parameter to curses.window.vline() function in curses
- Remove claim in documentation that the stripdir, prependdir and limit_sl_dest parameters of compileall.compile_dir() and compileall.compile_file() could be bytes.
-Use sphinxext-opengraph to generate OpenGraph metadata

Tests:
- test_tarfile has been updated to pass when run as a high UID
- Start running SSL tests with OpenSSL 3.1.0-beta1
- Add functional test for Argument Clinic

Build:
- Allow overriding Windows dependencies versions and paths using MSBuild properties

Windows:
- Ensure the install path in the registry is only used when the standard library hasn’t been located in any other way.
- The py.exe launcher now correctly filters when only a single runtime is installed. It also correctly handles prefix matches on tags so that -3.1 does not match 3.11, but would still match 3.1-32.
- Restore ability to launch older 32-bit versions from the py.exe launcher when both 32-bit and 64-bit installs of the same version are available.
-Fixed an issue where writing more than 32K of Unicode output to the console screen in one go can result in mojibake.
- Ensures the PythonPath registry key from an install is used when launching from a different copy of Python that relies on an existing install to provide a copy of its modules and standard library.
- Restores support for the py.exe launcher finding shebang commands in its configuration file using the full command name.
- Update Windows installer to OpenSSL 1.1.1s
- bpo-43984: winreg.SetValueEx() now leaves the target value untouched in the case of conversion errors. Previously, -1 would be written in case of such errors.