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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.