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

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

Python (64-bit) 軟體圖示 Python (64-bit) 3.6.5 (64-bit) 資料更新 2018-03-13 閱讀約 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.6.5.amd64.exe · 30.3 MB · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

Security:
- Minimal fix to prevent buffer overrun in os.symlink on Windows
- Regexes in difflib and poplib were vulnerable to catastrophic backtracking. These regexes formed potential DOS vectors (REDOS). They have been refactored.

Core and Builtins:
- Fixed jumping out of “with” block by setting f_lineno.
- Prevent jumps from ‘return’ and ‘exception’ trace events.
- Update Valgrind suppression list to account for the rename of Py_ADDRESS_IN_RANG to address_in_range.
- Pdb and other debuggers dependent on bdb.py will correctly step over (next command) native coroutines.
- Improve suggestion when the Python 2 form of print statement is either present on the same line as the header of a compound statement or else terminated by a semi-colon instead of a newline.
- Fix possible crashing in builtin Unicode decoders caused by write out-of- bound errors when using customized decode error handlers.
- Improved frozenset() hash to create more distinct hash values when faced with datasets containing many similar values.
- The __debug__ constant is now optimized out at compile time.
- sys.flags.hash_randomization is now properly set to 0 when hash randomization is turned off by PYTHONHASHSEED=0.
- The optimizer is now protected from spending much time doing complex calculations and consuming much memory for creating large constants in constant folding.
- repr() on a dict containing its own values() or items() no longer raises RecursionError; OrderedDict similarly. Instead, use ..., as for other recursive structures.
- Leading whitespace is now correctly ignored when generating suggestions for converting Py2 print statements to Py3 builtin print function calls.
- The repr of deeply nested dict now raises a RecursionError instead of crashing due to a stack overflow.

Library:
- lib2to3 now properly supports trailing commas after *args and **kwargs in function signatures.
- Avoid failing in multiprocessing.Process if the standard streams are closed or None at exit.
- Skip sending/receiving data after SSL transport closing.
- Fix ctypes pass-by-value for structs on 64-bit Cygwin/MinGW.
- Fix inspect.signature() for single-parameter partialmethods.
- Expose several missing constants in zlib and fix corresponding documentation.
- Fixed tarfile.itn handling of out-of-bounds float values.
- The ssl module now detects missing NPN support in LibreSSL.
- dbm.open() now encodes filename with the filesystem encoding rather than default encoding.
- In os.dup2, don’t check every call whether the dup3 syscall exists or not.
- Rewrite confusing message from setup.py upload from “No dist file created in earlier command” to the more helpful “Must create and upload files in one command”.
- In tkinter, after_cancel(None) now raises a ValueError instead of canceling the first scheduled function.
- Make sure sys.argv remains as a list when running trace.
- Fixed asyncio.Condition issue which silently ignored cancellation after notifying and cancelling a conditional lock.
- Fixed refleaks of __init__() methods in various modules.
- Fixed guessing quote and delimiter in csv.Sniffer.sniff() when only the last field is quoted.
- socket: Remove TCP_FASTOPEN, TCP_KEEPCNT flags on older version Windows during run-time.
- Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4.
- The ctypes module used to depend on indirect linking for dlopen. The shared extension is now explicitly linked against libdl on platforms with dl.
- Fixed asyncio.Lock() safety issue which allowed acquiring and locking the same lock multiple times, without it being free.
- Do not include name field in SMTP envelope from address.
- Fix email address header parsing error when the username is an empty quoted string.
- distutils’ upload command no longer corrupts tar files ending with a CR byte, and no longer tries to convert CR to CRLF in any of the upload text fields.
- uuid.uuid1 no longer raises an exception if a 64-bit hardware address is encountered.
- Fix the error handling in Aifc_read.initfp() when the SSND chunk is not found.
- On FreeBSD and Solaris, os.strerror() now always decode the byte string from the current locale encoding, rather than using ASCII/surrogateescape in some cases.
- The nis module is now compatible with new libnsl and headers location.
- Improve ABCMeta._dump_registry() output readability
- glibc has removed Sun RPC. Use replacement libtirpc headers and library in nis module.
- Ensure that truncate() preserves the file position (as reported by tell()) after writes longer than the buffer size.
- Don’t unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
- The SSL module no longer sends IP addresses in SNI TLS extension on platforms with OpenSSL 1.0.2+ or inet_pton.
- urllib.parse.urlsplit() does not convert zone-id (scope) to lower case for scoped IPv6 addresses in hostnames now.
- Fix bdist_wininst of distutils for CRT v142: it binary compatible with CRT v140.
- A single empty field is now always quoted when written into a CSV file. This allows to distinguish an empty row from a row consisting of a single empty field.
- Raise NotImplementedError instead of SystemError on platforms where chmod(..., follow_symlinks=False) is not supported.
- The getnode() ip getter now uses ‘ip link’ instead of ‘ip link list’.
- Ensure TCP_NODELAY is set on Linux.
- The locale.localeconv() function now sets temporarily the LC_CTYPE locale to the LC_NUMERIC locale to decode decimal_point and thousands_sep byte strings if they are non-ASCII or longer than 1 byte, and the LC_NUMERIC locale is different than the LC_CTYPE locale. This temporary change affects other threads. Same change for the str.format() method when formatting a number (int, float, float and subclasses) with the n type (ex: '{:n}'.format(1234)).
- Importing native path module (posixpath, ntpath) now works even if the os module still is not imported.

Documentation:
- Clarify docs for -O and -OO. Patch by Terry Reedy
- Update link to w3c doc for xml default namespaces
- Document __getattr__() behavior when property get() method raises AttributeError
- Modify RE examples in documentation to use raw strings to prevent DeprecationWarning and add text to REGEX HOWTO to highlight the deprecation
- Improve docstrings for pathlib.PurePath subclasses
- Explain real behaviour of sys.settrace and sys.setprofile and their C-API counterparts regarding which type of events are received in each function

Tests:
- Fix failing test_asyncio on macOS 10.12.2+ due to transport of KqueueSelector loop was not being closed
- Fix test_hashlib to not fail if the _md5 module is not built
- Fix faulthandler_suppress_crash_report() used to prevent core dump files when testing crashes. getrlimit() returns zero on success
- Debian Unstable has disabled TLS 1.0 and 1.1 for SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or PROTOCOL_TLSv1_2 to make them pass on Debian

Build:
- Fix segfault of the crypt module when libxcrypt is provided instead of libcrypt at the system

Windows:
- Fix potential use of uninitialized memory in nt._getfinalpathname
- Fix a memory leak in os.chdir() on Windows if the current directory is set to a UNC path
- Fixed WindowsConsoleIO.write() for writing empty data
- Ensures activate.bat can handle Unicode contents
- Improves handling of denormalized executable path when launching Python
- Use the correct encoding for ipconfig output in the uuid module
- Fix os.readlink() on Windows, which was mistakenly treating the PrintNameOffset field of the reparse data buffer as a number of characters instead of bytes
- Create standalone _distutils_findvs module

macOS:
- Provide an additional, more modern macOS installer variant that supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied third-party libraries to OpenSSL 1.0.2n, XZ 5.2.3, and SQLite 3.22.0. The 10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.8.

IDLE:
- Set __file__ while running a startup file. Like Python, IDLE optionally runs one startup file in the Shell window before presenting the first interactive input prompt. For IDLE, -s runs a file named in environmental variable IDLESTARTUP or PYTHONSTARTUP; -r file runs file. Python sets __file__ to the startup file name before running the file and unsets it before the first prompt. IDLE now does the same when run normally, without the -n option
- Simplify and rename StringTranslatePseudoMapping in pyparse
- Change str to code in pyparse
- Remove unused code in pyparse module
- Add tests for pyparse
- Using the system and place-dependent default encoding for open() is a bad idea for IDLE’s system and location-independent files
- Add “encoding=utf-8” to open() in IDLE’s test_help_about. GUI test test_file_buttons() only looks at initial ascii-only lines, but failed on systems where open() defaults to ‘ascii’ because readline() internally reads and decodes far enough ahead to encounter a non-ascii character in CREDITS.txt
- Update configdialog General tab docstring to add new widgets to the widget list

Tools/Demos:
- 2to3 and lib2to3 can now read pickled grammar files using pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and lib2to3 work when run from a zipfile
- Fix pygettext not extracting docstrings for functions with type annotated arguments

C API:
- Undocumented C API for OrderedDict has been excluded from the limited C API. It was added by mistake and actually never worked in the limited C API