Cross-Platform and Python and wxPython01 Jan 2009 01:59 pm

New programmers start using Python and wxPython each week. So it follows that every few months, I see people asking how to redirect stdout to a wx.TextCtrl on comp.lang.python or the wxPython mailing list. Since this is such a common question, I thought I would write an article about it. Regular readers will know that I have mentioned this concept before in a previous post.


Continue Reading »

Python27 Sep 2008 03:44 pm

I recently started a Python Users Group for Iowa as there didn’t seem to be one and I thought it would be fun. We had our first meeting last Wednesday, the 24th of September, 2008. We had eight people there, including myself. Of that group, only half knew how to program in Python. Thus, we decided it would be a good idea to host a Python Crash Course to get the rest of our members up to speed at our next meeting.

I am currently planning the topics we should cover and how to split up the teaching responsibilities. I think it will be a fun experience with plenty of room to grow. Currently, I want to go over iterables, conditionals, builtins, etc. I think we’ll go over constructing a parser and some really simple GUI stuff too. I even have a volunteer who wants to show off his django skills.

I’ll be sure to write about how it goes and what we cover and post our materials online if I can.

Python26 Sep 2008 08:39 pm

Porting an application from one OS to another can be a time consuming process. Fortunately, wxPython takes the pain out of the process. This is only the 2nd time that I’ve ported my code to Linux. I usually write for Windows XP on Windows XP at work. When I originally wrote wxPyMail for work, I used Mark Hammond’s PyWin32 library to get the user’s full name and username to help in constructing their return address. Here’s the code I used then:


Continue Reading »

Python27 Aug 2008 08:05 pm

In this article, I am going to go over the steps needed to package up my program, wxPyMail, so I can distribute it to other Windows users. I will be using Andrea Gavana’s excellent GUI2Exe utility for creating an executable and I’ll use Inno Setup to create an installer. I’ve been told that Andrea is working on a new version of his application, so when it comes out I’ll re-work this article for that version and post it too.


Continue Reading »

Python and wxPython16 Aug 2008 12:33 pm

I thought it would be a good idea to write a sample application in wxPython to show how to put all the pieces together and make something useful. At my day job, I created a little program to send emails because we had a lot of users that missed the mailto functionality that we lost when we switched from Exchange/Outlook to Zimbra. It should be noted that this is a Windows only application currently, but it shouldn’t be too hard to make it more OS-agnostic.

I’ll split this article into three pieces: First is creating the interface; second is setting up the data handling and third will be creating a Windows executable and connecting it to the mailto handler.
Continue Reading »

Cross-Platform and Python and wxPython02 Aug 2008 01:13 pm

Lately on the wxPython mailing list, there’s been a fair amount of traffic on changing the mouse icon. In this article I will describe different ways to manipulate the cursor with wxPython. To follow along, I recommend that you download Python 2.4 or higher and wxPython 2.8.x.


Continue Reading »

Cross-Platform and Python and wxPython02 Jul 2008 07:27 am

Menus and toolbars are used in just about every modern program in existence, barring the ones that only run from the command line. In this post, we’ll learn how to create them using the wxPython toolkit. Here’s what you’ll need to follow along:


Continue Reading »

Cross-Platform and Python and wxPython11 Jun 2008 06:52 am

When I create an application, I usually want to include an “About” box to let the user know more about the application, myself and to give shout outs to anyone who may have helped in the creation of my program. One cool feature wxPython provides is a custom AboutBox widget. I think it looks a little odd, so I created my own About box using the HtmlWindow widget. However, I’ll show how to do it both ways in this article.


Continue Reading »

Python and Windows and wxPython09 Jun 2008 09:15 pm

About a week ago, I wrote that I was working on a sample application that I would be posting here. As I worked on it, I realized that I needed to figure out a way to break it up in a way that was simple, organized and generic. Thus, I decided to create a series of “how-to” articles on the bits and pieces of my application and post them here. Then I will post another article that walks through putting all the pieces together.

The pieces for this application include the following:

  • The wx.BoxSizer
  • The wx.Dialog class
  • The wx.Menu, wx.StatusBar and wx.Toolbar
  • The wx.AboutBox

Note: I already have a BoxSizer tutorial done.

I think that covers the main wxPython bits. I will also be using the standard Python 2.5 library’s email, urllib and smtplib modules as well as a few win32 specific modules. I think you will find this set of articles quite educational. Please be sure to let me know what you think.

Python and wxPython29 May 2008 06:58 am

As planned, I copied some of my tutorials to the official wxPython wiki. Currently I only have the sizer tutorials over there.

I am working on a series that will show how to build a simple application from the ground up. Hopefully I can take the bits and pieces of it and make it easy to follow. If so, I’ll post the bits and pieces to the wiki too, after I get some feedback so I can shine them up a bit.

You should be seeing the first post of that series soon. Hopefully by the weekend.

Next Page »