Entries tagged with “Tkinter”.


Redirecting stdout seems to be a pretty common request on the wxPython users group, so I decided to see how easy it would be to do it with Tkinter. The typical use case for redirecting stdout or stderr is that you are calling some other process (like ping or tracert) and you want to catch what it’s doing to put it into your UI. Usually you can just use Python’s subprocess module and call its communicate() method to access the data. Then you can just print it to stdout and it will magically appear in your UI’s widget of choice.

Our finished user interface will look something like the following:

tkredirect.png

Let’s find out how to do this with Tkinter: (more…)

Today we’re going to take a look at Tkinter! I was curious about how one would go about hiding a frame and then re-showing it using Tkinter and I kept finding threads (like this one) that talked about using withdraw() and deiconify() but didn’t really provide any usable code. In wxPython, I did this sort of thing using pubsub. We’ll go over three different versions of how to hide and show the root frame. (more…)

I recently bought Modern Tkinter for Busy Python Developers by Mark Roseman from Amazon and just finished it yesterday. I think it’s pretty new, but I can’t find the release date for it now. Anyway, let’s get on with the review!

Quick Review

  • Why I picked it up: I bought this book because I’d been planning to dig into other Python GUI toolkits anyway and I haven’t seen a new Tkinter book since John Grayson’s Python and Tkinter Programming
  • Why I finished it: It has a pretty good writing style, although the widgets chapters started to drag
  • I’d give it to: Anyone wanting to make their Tkinter applications look more native or learn a little about Tkinters new theming system.

(more…)