Skip to Content
Python 技術手冊 第三版
book

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced content levelIntermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
發布工具(distutils)與 setuptools
|
217
點號開頭的模組或套件名稱,而且只能在
from
述句中使用。
from . import
X
會在目前的套件中找尋名為
X
的模組或物件;
from .X import y
則會在目
前套件的模組或子套件
X
中找尋名為
y
的模組或物件。如果你的套件有子
套件,它們的程式碼可以在你置於
from
import
之間的模組或子套件名稱
開頭使用多個點號來存取套件中較上層的物件。多一個點就等於在目錄階
層架構中多往上一層。過度使用這個功能很容易損害你程式碼的清晰度,
所以請小心使用,並只在必要時才用。
發布工具(distutils)與 setuptools
Python 的模組、擴充功能(extensions)以及應用程式,能以數種形式封裝
packaged)並發布(distributed):
壓縮過的封存檔
compressed archive files
一般是
.zip
.tar.gz
(即
.tgz
),這兩種形式都是可移植的,另外也有許
多其他的形式可用來封存且壓縮檔案與目錄所構成的樹狀結構
自我解封或自我安裝的可執行檔
executables
一般是 Windows
.exe
自成一體
不需要安裝就可執行的可執行檔
舉例來說,Windows
.exe
Unix 上具有簡短指令稿前綴(short
script prefix)的 ZIP 封存檔、Mac
.app
等等
平台限定的安裝器
installers
舉例來說,Windows 上的
.msi
、許多 Linux ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

測試驅動開發|使用 Python

測試驅動開發|使用 Python

Harry J.W. Percival
Linux 内核观测技术BPF

Linux 内核观测技术BPF

David Calavera, Lorenzo Fontana

Publisher Resources

ISBN: 9789864766819