17.2. A “Hello World” wxPython Application

All wxPython applications take the same basic shape. Figure 17-11 is a screen shot of a simple wxPython application.

Figure 17-11. A very simple wxPython application.

Here is the code.

 CD-ROM reference=17001.txt # Import wxPython functionality from wxPython.wx import * class MyFrame(wxFrame): def __init__(self, parent, id, title): # Initialize wxFrame wxFrame.__init__(self, parent, -1, title, wxDefaultPosition, wxSize(450, 300)) # Create File, Edit, and Insert menus and menu items. FileMenu = wxMenu() FileMenu.Append (1001,"Exit") menubar = wxMenuBar() menubar.Append (FileMenu,"File") self.SetMenuBar(menubar) ...

Get XML Processing with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.