Archive for February, 2008

Using wx.Image & wx.StaticBitmap

Friday, February 29th, 2008

Now we actually load and display an Image! We use a wx.Image which reads a graphic image from our hard-drive.

First we show the image’s dimensions in the status-bar using .SetStatusText(…). Next we use the new ShowBitmap(self) function to convert the Image to a wx.StaticBitmap which is shown inside the Panel. We ask the Frame to resize itself to fit the picture and also to center itself on-screen.

This is one of our Club ShowMeDo Python tutorials, these build upon our free wxPython tutorials which live with our 179 Python tutorials. The source code for this episode is freely available (they all are) further down the video’s page.

“Really quite enjoying this series - coming back everyday to see if another part has been uploaded!” - John Montgomery

“…Nevertheless, this is still one of the best tutorial videos I’ve ever seen and trust me: I’ve seen lot’s of ‘em!” - Lucas Holland

wx.FileDialog and CreateStatusBar for our wx Image Viewer

Monday, February 25th, 2008

In the fifth episode of our wxPython Image Viewer tutorial we look at creating a wx.FileDialog() File-Opener followed by using Frame.CreateStatusBar() to add a 2-column status bar to the Frame. We’re now half-way through the series, soon we’ll be displaying an image and testing your skills with some exercises.

This is one of our Club ShowMeDo tutorials which builds upon Kyrans free wxPython tutorial. The Overview episode will show you what we’re building and discusses which parts of wxPython are covered.

In the FileOpener episode we create a customised file-open dialog which (for now) just sets the Frame’s title with .SetTitle(…). I discuss using a modal dialog and why we use dlg.Destroy(). Briefly I show how to use wx.BeginBusyCursor() and wx.EndBusyCursor().

In the following short StatusBar episode we add a 2-column status-bar to the Frame and test that menu help text and user-specified status text is shown correctly.

“Really quite enjoying this series - coming back everyday to see if another part has been uploaded!” - John Montgomery

The Club ShowMedo Python tutorials are aimed at new Python programmers and they enable us to support all the free tutorials that we carry. This series was originally announced here. These tutorials are a part of our 177 Python tutorial videos.

Menus and Binding for wxPython Image Viewer

Monday, February 18th, 2008

The fourth episode of the wxPython Image Viewer tutorial - Add Menus, wx Ids, Binding - has just been published. This is one of our subscriber-only Python tutorials which builds upon Kyran’s original free wxPython tutorial.

In this episode we add a MenuBar and Menu items to the skeleton application. Since Menus force us to look at wxPython’s ids we look at ‘-1′, wx.ID_ANY, wx.NewId() and user-defined ids. The source code (shown below the video) shows that we use ‘-1′ as a matter of choice.

We also look at using object.GetId(), Wingware’s Wing IDE for help, binding functions to menu items and self.Destroy() to close the application.

“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.” - Lucas

Club ShowMeDo Python tutorials are aimed at new Python programmers and they enable us to support all the free tutorials that we carry. This series was originally announced here.

New Django Videos at ShowMeDo

Saturday, February 16th, 2008

We have new Django videos at ShowMeDo - ‘Empty‘ (Michael Trier) has a 7-part series on the Django syndication framework, management, NewForms, URL mapping and application settings.

Siddhi has extended his super-popular Create a Wiki in 20 minutes series with a 3rd entry on Adding tags to the wiki.

These videos can be seen in our Django portal which is a part of our Python portal.

About ShowMeDo: We host tutorial and demo videos about software, mostly open-source. We welcome new Authors and new submissions. We run a Learn Python with Ease subscription series aimed at getting new Python programmers up to speed with tutorials, exercises and overviews.

Build a wxPython Image Viewer

Thursday, February 14th, 2008

The first episodes for our Build a wxPython Image Viewer series are ready with more episodes to follow over the coming weeks. In total we will have 10 episodes which walk you through building the Image Viewer from scratch, including the skeleton code you need to develop your own wxPython applications.

The series is aimed at Python users who have a little coding experience but no experience with wxPython. Exercises and background material are included.

The 3 minute overview will show you what we cover, then we develop a Skeleton wxPython Application (which you can use for your own applications) and discuss a Debug Tip and wxPython Naming Conventions.

This series is a part of our new Club ShowMeDo which already includes over 3 hours of Python tutorials for new Python programmers. Our current material covers reading/writing files, some popular IDEs, unit-testing with nosetests, refactoring and GUI programming.

The next episodes in the series covering wxPython menus, the file-open dialog and the status-bar will be published over the following week. If you’re a Member (join here) of ShowMeDo then you’ll receive our monthly Update Mail which includes details of the videos we publish.

ShowMeDo is Teaching Python

Tuesday, February 12th, 2008

Last weekend we opened Club ShowMeDo for new Python programmers. This week we begin publishing our first new series - building a wxPython Image Viewer in very simple steps, aimed at new wxPython programmers. The series will assume some prior Python knowledge and no prior wxPython knowledge.

We’ll release a few episodes each week and in total we have 10 episodes planned lasting around 45 minutes. 3 exercises (with solutions!) will be included to stretch the viewer’s knowledge. I plan to publish the initial episodes by Friday.

This is the first new Python series that I’ve worked on in a while and now I’ll regularly publish new series. My previous two Python series are also a part of the Subscription plan.

In the first series I show a new Python programmer how to build and debug a simple unit-tested file reader using PyDev and introduce IDLE. In the second series I build a robust csv-file-reader which does some math and uses the easygui GUI toolkit for easy interaction with the user.

Both of these series show fully-worked examples which teach a new programmer the fundamentals of Python programming, including the need for unit-testing and documentation.

We have plans for many new series which build on this theme - fully worked examples which build into useful applications. New python programmers can learn more about our Subscriptions here.