the wxpython gui library to use the wxpython library it is necessary to import the wx module import wx create the application object app wx app(now create frame (representing the windowframe wx frame(parent=nonetitle=simple hello world'and add text label to it text wx statictext(parent=framelabel'hello python'display the window (frameframe show(start the event loop app mainloop(the program also creates new instance of the application object called wx app(every wxpython gui program must have one application object it is the equivalent of the main(function in many non-gui applications as it will run the gui application for you it also provides default facilities for defining startup and shutdown operations and can be subclassed to create custom behaviour the wx statictext class is used to create single (or multipleline label in this case the label shows the string 'hello pythonthe statictext object is constructed with reference to its parent container this is the container within which the text will be displayed in this case the statictext is being displayed directly within the frame and thus the frame object is its containing parent object in contrast the frame which is top level windowdoes not have parent container also notice that the frame must be shown (displayedfor the user to see it this is because there might be multiple different windows that need to be shown (or hiddenin different situations for an application finally the program starts the applicationsmain event loopwithin this loop the program listens for any user input (such as requesting that the window is closed the wx app class the wx app class represents the application and is used tostart up the wxpython system and initialise the underlying gui toolkitset and get application-wide propertiesimplement the native windowing system main message or event loopand to dispatch events to window instances