Join Club ShowMeDo to Learn Python!

This series is a part of Club ShowMeDo. Click to learn why you should join our club with a simple monthly subscription.

  • We teach Python and all the cool modules
  • Topics include beginner Python, GUIs, Web and Desktop Apps
  • Long, specially crafted video tutorials just for you
  • Club video tutorials extend our normal Free content
  • Save your time - we've done the research for you
  • Keep your skills up-to-date
  • Learn at your own pace, everything you need is shown to you
  • Over 12 hours of archived material are waiting for you in the club

Name: [002] Ian Ozsvald
Member: 128 months
Authored: 181 videos
Description: I am the co-founder of ShowMeDo (see, author of `The Screencasting Handbook <>`_ and the founder of the professional screencast production company `ProCasts <>`_: .. image:: ...

Your own Skeleton wxPython Application [ID:526] (2/14)

in series: Build a wxPython Image Viewer

(Showmedo is undergoing major changes. To report any problems viewing the videos please email us and include browser and OS specifics. Cheers - Kyran.)

We start from first principles by walking through a skeleton wxPython application - you can use this skeleton to build your own wxPython applications too.

We use an over-ridden wx.App and wx.Frame to build a wx.Panel.

The use of a constant and custom style for the wx.Frame is discussed and we walk through the basic event sequence for starting a wxPython application.

Simple tests for you - changing the background colour of the wx.Panel, commenting out the call to Center, commenting out the call to Show.

Links - documentation for wx.App, wx.Frame, wx.Panel.

Download 3 test images in a zip file. The necessary source code is shown below in the Source Code tab.

import wx


class Frame(wx.Frame):
    def __init__(self, parent, id, title):
        style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER) # XOR to remove the resizeable border        
        wx.Frame.__init__(self, parent, id, title=title, size=MAIN_WINDOW_DEFAULT_SIZE, style=style)
        self.Center() # open in the centre of the screen
        self.panel = wx.Panel(self)
        self.panel.SetBackgroundColour('White') # make the background of the window white

class App(wx.App):
    def OnInit(self):
        self.frame = Frame(parent=None, id=-1, title='Image Viewer')
        return True
if __name__ == "__main__":       
    # make an App object, set stdout to the console so we can see errors
    app = App()

Got any questions?

Get answers in the ShowMeDo Learners Google Group.

Video statistics:

  • Video's rank shown in the most popular listing
  • Video plays: 0 (since July 30th)
  • Plays in last week: 0
  • Published: 102 months ago

Thank-yous, questions and comments

If this video tutorial was helpful please take some time to say thank-you to the authors for their hard work. Feel free to ask questions. Let the author know why their video tutorial was useful - what are you learning about? Did the video tutorial save you time? Would you like to see more?

You may also want to see our ShowMeDo Google Group to speak to our active users and authors.

Your email address will not be published.

Show some quick comments >>

All comments excluding tick-boxed quick-comments

Nice bite sized bits.



24. Fri, 26 Feb 2010 11:29

I would like to run C/C++ executables using WXPYTHON.

I have been using the DOS cmd window to do that I would like to change to Python scripts

C:\ > program.exe arg1 arg2 arg3 arg4

and the (printf) output from the executable is piped to the cmd window

A very good introduction. Showing the example, then making changes on the fly really shows off how simple it is to code in python.

as usual you have done a great job.

Ur explaination is very clear ty so much

This is great stuff. Thanks!!

Hi Ian~

I am having some trouble running wXPython with IPy and Python 2.6. My IPy is set up with a text editor, so that I can write and save my script in the text editor, then execute it in iPy. Unfortunately, I only get one go with a given file. On the second attempt to use wxPython, Python crashes.

Are others experiencing similar difficulties? Is wxPython known to be buggy, or to have poor interactions with Python 2.6?

Thanks Ian!

download link was broken.

18. anonymous Fri, 29 May 2009 15:28

unfortunately i couldnt be able to download the vedios.It shows.. the URL not found...

plz check it..

its really a good vedio tutorial...

17. anonymous Fri, 29 May 2009 15:23

unfortunately i couldnt be able to download the vedios.It shows.. the URL not found...

plz check it..

its really a good vedio tutorial...

Nice well explained start, thanks!

Great video

Need something to get me up to speed with wxpython fast and these videos are helping a lot.

Now if someone could do a video on how to get wxpython onto the neagle board/gumstix overo, that would be perfect!


Where is the source code.

I see the text:

"The necessary source code is shown below in the Source Code tab"

but I can't find it

Review of Your own Skeleton wxPython Application

Thanks Ian! I'm enjoying this series about wxPython, this really helps to understand the bits and pieces and how they go together to make a coherent program. This also helped to clarify things to know that this is the bare minimum to create this skeleton and that more advanced wx applications are more or less built on this framework.

Hi David. I don't know of any incompatibility (though I don't have, nor do I want to try, Vista!). I'm using standard wxPython, you can see similar code in the wxPython book, there's nothing unusual in my usage.

The code works on XP and Linux for sure.

You could try posting to the wxPython Users mailing list ( where I'm sure someone could help with Vista.


When I try to close the window from this lesson the frame pops backup up and then Python hangs. I'm running on Windows Vista. Is there a known incompatibility or some

Python 2.5.2 and

wxPython (msw-unicode)

These are great lessons by the way.

Hi anonalous_underdog. We do plan to release the subscriber-club videos into the free pool over time (as stated on our subscription page) but note that it will take a while - possibly a year.

In the meantime, please enjoy the 470+ free tutorial videos that we host.


I'll wait for the rest of the videos to be free for download, thanks man

Hi Redogre, thanks for the comment. I'll take issue with Python 'not being a full blown language' - of course it is :-) I do *all* of my artificial-intelligence (pretty cutting-edge stuff) using it.

Don't mistake the clean design and short programs for a lack of power - I switched from C++ to Python 4 years ago and I have never looked back.

Python is both excellent for beginners (because it is easy to learn) and for accomplished programmers (because you get stuff done so quickly - be it writing a GUI, a web app, writing research code or making a game).



ps. do take a look at the new Google Group ( where you can discuss any questions you have with others who are watching the videos at the same time as you.

Review of Your own Skeleton wxPython Application

I really enjoyed the tutorial. Im new to python, and programing in general. I picked python because after looking over C# Java and Python, the general view is that Python is a good begininer langauge because its mainly a script language and not a full blown language. So your walk threws are very handy for the true begininer. I had some issues with this at the begining because I did not know you had to download wxpython seperatly, once i figured that out, the tutorial worked flawlessly. Thanks for your time and effort

6. anonymous Wed, 27 Feb 2008 05:30

Will have to search for other wx.dialog documentation/tutorials on the net :(

Do I get any Students Discounts :(

This was a great video introduction to wxPython. You covered the basics of creating a window to get started with wxPython very well. I'm look looking forward to watching the rest of this series.

Very professional, great work on the length of the video, lots of detail in the explanation yet it only lasts 8 mins.

This is an excellent tutorial screencast. Not only is the presentation very professional and well paced, you're also a very, very good teacher.

I particularly liked how you didn't dig too deep into the code in this episode, as it would only confuse beginners. At the same time you covered enough to justify an episode.

VERY, VERY good job, I'd say one of the, if not the best tutorial video and series available on ShowMeDo today.

Congratulations on this excellent piece of work!


Video published, thanks for contributing to ShowMeDo

Showmedo is a peer-produced video-tutorials and screencasts site for free and open-source software (FOSS)- with the exception of some club videos, the large majority are free to watch and download.

how to help » about » faq »

Educating the Open-source Community With Showmedo

Although as important as the software it supports, education and documentation are relatively neglected in the Open-source world. Coders love to code, and explaining how best to use or improve the software tends to be deferred or even sidelined.

At Showmedo we believe the community can play a vital role here and also say thanks for the tools and software that make our lives easier. If you have a piece of software you love or a programming langugage you are enthusiastic about, why not make a screencast showing others how to use it? All the stuff you wish you'd been told, the tips, tricks, insights that would have saved you time and frustration.

Screencasting is easier than you think, and we're happy to help you. You can emailus for advice or just use some of the how-to screencasts on the site. This screencasting learning-pathis a good place to start.

Kudos and Thanks for Ian

3 Minute Oveview (What Does Python Look Like?)

simple and informative. you draw me in
70 months ago


Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.