Home >> Blog >> 如何應用 wx python - wxpython 簡介
如何應用 wx python - wxpython 簡介
wx Python是一個流行的跨平台 GUI 工具包wxWidgets (用 C++ 編寫)的 Python 包裝器。wx Python 由 Robin Dunn 和 Harri Pasanen 共同開發,被實現為 Python 擴展模塊。
就像 wxWidgets 一樣,wx Python 也是一個免費軟件。可以從官網http://wx Python.org下載。許多操作系統平台的二進製文件和源代碼可在此站點上下載。
wx Python API 中的主要模塊包括一個核心模塊。它由wxObject類組成,它是 API 中所有類的基礎。控制模塊包含 GUI 應用程序開發中使用的所有小部件。例如,wx.Button、wx.StaticText(類似於標籤)、wx.TextCtrl(可編輯文本控件)等。
wx Python API 具有 GDI(圖形設備接口)模塊。它是一組用於在小部件上繪圖的類。字體、顏色、畫筆等類是其中的一部分。所有容器窗口類都在 Windows 模塊中定義。
wx Python 的官方網站還託管了 Project Phoenix——一個用於 Python 3.* 的 wx Python 的新實現。它專注於提高速度、可維護性和可擴展性。該項目於 2012 年開始,目前仍處於測試階段。
視窗
Windows 操作系統(32 位和 64 位)的預構建二進製文件可在http://www.wx Python.org/download.php頁面上找到。可用的最新安裝程序版本是 - wx Python3.0-win32-3.0.2.0-py27.exe用於 32 位 Python 2.7 wx Python3.0-win64-3.0.2.0-py27.exe用於 64 位 Python 2.7
wx Python 演示、示例和 wxWidgets 文檔也可以在同一頁面上下載。
wx Python3.0-win32-docs-demos.exe
Linux
許多 Linux 發行版的 wx Python 二進製文件可以在它們各自的存儲庫中找到。必須使用相應的包管理器來下載和安裝。例如在 Debian Linux 上,以下命令應該能夠安裝 wx Python。
sudo apt-get install python-wxgtk3.0
蘋果系統
可在官方網站的下載頁面上以磁盤映像的形式為 MacOS 預構建二進製文件。
wxpython
python
app
the
to
you
of
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wxpython
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wx
wxpython's
the wxpython
the wxpython
the wxpython
the wxpython
the wxpython
the wxpython
app mainloop
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
the
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
to
frame
frame
frame
you
you
you
you
you
you
you
you
you
you
you
you
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
pr
import wx
event
source
source
source
source
source
classes
classes
lib
lib
lib
lib
lib
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
as
when
when
when
when
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in
in