Python


One day at work last month, I was told that we had a feature request for one of my programs. They wanted a “dark mode” for when they used my application at night as the normal colors were kind of glaring. My program is used in laptops in police cars, so I could understand their frustration. I spent some time looking into the matter and got a mostly working script put together which I’m going to share with my readers. Of course, if you’re a long time reader, you probably know I’m talking about a wxPython program. I write almost all my GUIs using wxPython. Anyway, let’s get on with the story! (more…)

One of the new agw widgets to be included in wxPython is one called the UltimateListCtrl. It’s a pure Python widget that can have pretty much any other widget stuck into any of the cells, which makes it really flexible. It also allows the skilled programmer the ability to add custom renderers to make the interface different. In this article, we will take a quick look at this fascinating widget. (more…)

If you’ve been in the wxPython community for more than a couple months, you will probably recognize the following question: “How do I bind multiple buttons to the same event handler and make them do different things?” Well, this article will show you how to do exactly that. (more…)

Recently, Andrea Gavana, developer of the agw library in the wxPython code base, released his newest widget: XLSGrid. It’s purpose is to faithfully reproduce the appearance of a Microsoft Excel spreadsheet (one worksheet per every instance of XLSGrid). This widget is based on wx.grid.PyGridTableBase and wx.grid.PyGridCellRenderer and requires xlrd. Andrea also recommends using Mark Hammond’s PyWin32 module or the widget’s formatting abilities will be very limited. If you’d like to read the full announcement, just go here.

(more…)

If you’re a long time reader of this blog, then you will know that I really like the wxPython GUI toolkit. Something that seems to stump new wxPython users is how to find out what styles and events each widget has though. It does take some practice to learn how the documentation works, but there’s a nice little program that Andrea Gavana put together that he calls the Windows Styles and Events Hunter. It was released a couple years ago on the mailing list, but I don’t think it was very popular. I use it for answering questions on the wxPython mailing list or on their IRC channel, so I know it’s pretty handy.

Here’s what it looks like in action:

Let’s take a look and try it out! (more…)

Another week is over and we have a new set of articles for you to check out this weekend. You can learn new things, try modules, and be productive. Or you can go party. Don’t forget about all the different PyCons going on this year around the world. There are local ones and International conferences.

That’s all for this week. Let me know if you find anything cool that you think I should highlight next time.

I’ve been kind of lazy about putting these out lately, but I have decided to try to do this more regularly. This week covers a lot of different topics including a controversial article from Steve Holden! You can also learn about an exotic location for a Python Conference, Sage and Meta-programming. If you’re new to Python, then you will be amazed at the diversity of the topics. These don’t even begin to scratch the surface of what is going on in the Python world, but they may whet your appetite. Enjoy!

  • Ever wanted to learn a little about Meta-programming in Python? Now’s your chance!
  • Don’t know Sage? Well, there’s a Beginner’s Guide for it out now and here’s a review by John Cook.
  • Steve Holden talks about Childish Behavior regarding the naming of a certain Python module
  • PyCon Australia’s schedule has been announced! Now you too can learn about Python and see Kangaroos in their natural habitat. I call that a win/win!
  • There’s an update on the Python African tour
  • For up to the minute Python news, check out Twitter
  • NWSGI 2.1 for IronPython 2.7 out now

There was a recent post on StackOverflow that I thought was interesting. It asked how to get the event name from the event object, such as EVT_BUTTON, rather than the event’s id number. So I did some investigation into the subject and there is nothing builtin to wxPython that does this task. Robin Dunn, creator of wxPython, recommended that I should create a dictionary of the events and their ids to accomplish this feat. So in this tutorial, we’ll take a look at how to go about that. (more…)

Have you ever wondered about how to change your font in wxPython? Well, now is your lucky day because that is exactly what this tutorial is going to cover. We will look at the following three items:

  • Built-in fonts of wxPython
  • The font dialog
  • The font enumerator demo from the wxPython demo

Fonts are an important part of your program and enhance your program’s readability. It’s always a good idea to make sure your fonts are the right size and place. Yes, that’s common sense, but sometimes common sense doesn’t happen in programming. Enough philosophizing. Let’s get to the meat of the article!

(more…)

PyCon 2011 (USA) is over. But a lot of people wrote articles about it. So in case you missed the action, you can check out a few of the articles about what happened. If you don’t see your favorite PyCon-related article here, let me know in the comments.

« Previous PageNext Page »