Name:
[002] Ian Ozsvald
Member:
90 months
Authored:
181 videos
Description:
I am the co-founder of ShowMeDo (see http://showmedo.com/about), author of `The Screencasting Handbook <http://thescreencastinghandbook.com>`_ and the founder of the professional screencast production company `ProCasts <http://procasts.co.uk>`_:
.. image:: http://procasts.co.uk/media/procasts_sma ...
Your own Skeleton wxPython Application [ID:526] (2/14)
in series: Build a wxPython Image Viewer
video tutorial by Ian Ozsvald, added 02/08
Name:
[002] Ian Ozsvald
Member:
90 months
Authored:
181 videos
Description:
I am the co-founder of ShowMeDo (see http://showmedo.com/about), author of `The Screencasting Handbook <http://thescreencastinghandbook.com>`_ and the founder of the professional screencast production ...
Our authors tell us that feedback from you is a big motivator. Please take a few moments to let them know what you think of their work.
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
MAIN_WINDOW_DEFAULT_SIZE = (300,200)
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')
self.frame.Show()
self.SetTopWindow(self.frame)
return True
if __name__ == "__main__":
# make an App object, set stdout to the console so we can see errors
app = App()
app.MainLoop()
- python
- beginner_programming
- programs
- code
- basics
- application
- episodes
- files
- learn
- first
- source
- information
- GUI
- builds
- IDE
- images
- wxpython
- end
- download
- programmers
- background
- knowledge
- test
- exercise
- little
- app
- wing
- starting
- wingware
- fully-worked
- documentation
- colour
- call
- platforms
- panel
- source_assistant
- exercise_solution
- sequence
Got any questions?
Get answers in the ShowMeDo Learners Google Group.
Video statistics:
- Video's rank shown in the most popular listing
- Video plays: 360 (since July 30th)
- Plays in last week: 0
- Published: 64 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.
All comments excluding tick-boxed quick-comments
Nice bite sized bits.
Thanks,
Mark
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.
unfortunately i couldnt be able to download the vedios.It shows.. the URL not found...
plz check it..
its really a good vedio tutorial...
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!
Thanks
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 (http://www.wxpython.org/maillist.php) where I'm sure someone could help with Vista.
Ian.
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 2.8.7.1 (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.
Ian.
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).
Cheers,
Ian.
ps. do take a look at the new Google Group (http://groups.google.com/group/showmedo-learners) 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
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!
Lucas
Video published, thanks for contributing to ShowMeDo
