範例
以下是一個簡單的wxPython的Hello World模塊,描述了在wxPython中的兩個主要物件(主視窗物件和應用程序物件),然後藉由呼叫MainLoop()控制事件驅動系統,而該系統負責該程式的使用者互動部分。
#!/usr/bin/env python import wx app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window. frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window. frame.Show(True) # Show the frame. app.MainLoop()
使用wxPython開發的程式
- BitTorrent,一種對等的BitTorrent應用程序。
- Google Drive,Google雲端存儲系統的桌面客戶端。
- GRASS GIS,一種免費且開源的地理信息系統。
- PlayOnLinux,一個Wine軟體相容層的圖形化前端。
