Category Archives: Technology

Tkinter book now available for pre-order

The cover of Python GUI programming with Tkinter by Alan D MooreExciting news!  My book is now available for pre-order from Packt Publications.    It won’t be out until June, but I’m 2/3 of the way through writing and pretty pleased with what I’ve got so far.

If you know a budding Python programmer who’s interested in writing desktop applications, this is going to be a great book for them; even if they don’t end up using Tkinter in the long run, they’ll learn a lot of good coding habits and application design techniques.

For example, I just finished up a chapter on unit testing that covers the Python unittest library in-depth and walks the reader through writing real tests on actual application code.  Beyond the basics, we deal with challenges like mocking out file access, testing mixin classes, and creating integration tests on our GUI elements.

If you have any questions about what is or isn’t in the book, or suggestions on topics I shouldn’t leave out, feel free to comment!

https://www.packtpub.com/application-development/python-gui-programming-tkinter

 

Big news: A book is on the way!

This blog has been a tad slow over the last year or so, mostly because I’ve been concentrating more on making music than writing code; but that all changed when I was contacted last month with an opportunity to write a book on Tkinter.  So, sometime early next summer, my first book, Python GUI Programming with Tkinter, will be available from Packt Publications.

Wait, Tkinter?  In 2018??

Yes, I know what you’re thinking; it’s either “What on earth is Tkinter?” or “Why would you do a book on it in 2018?”

For those asking the first question, Tkinter is a GUI programming library built into the Python standard library; and if that doesn’t mean anything to you, you might not be the target demographic for this book. 🙂

For those asking the second question — well, hear me out.

To start with, this book isn’t just going to be a dry Tkinter how-to; it’s fundamentally a book about writing end-user applications and choosing the right technology to solve real-world problems (particularly in the workplace).  I’ll be going through the process of dissecting a business need and building an appropriate software solution.

The simplicity and ready availability of Tkinter makes it a decent choice for teaching budding Python programmers these principles.

But as for Tkinter itself, I think it gets a bum rap from the Python community.  Sure, it’s not a glamorous, trendy library.  It doesn’t have declarative syntax, a million and one widgets for every occasion, a Javascriptesque mini-language for form automation, or a 100 Mb browser exectuable bundled into it.  But Tkinter hardly deserves the pariah status some Python coders give it.

The three things I mainly hear about Tkinter are:

It’s ugly

Not so many years ago, Tkinter was hideous.  Aliased fonts, limited theming, and widgets that escaped from a 1990s Unix desktop made for a look that screamed LEGACY and indelibly marked Tkinter as deprecated in the minds of many Python coders.  This has changed though; fonts are now anti-aliased, and the TTK widget set provides themable, platform-appropriate widgets.  Tkinter may not give you the Material Design look or animated semitranslucent widgets, but for your standard utility, control panel, or data-drive application, it looks fine.

The widgets are too simple

Tkinter’s form widgets are a tad disappointing when you first use them.  Comboboxes and Spinboxes don’t behave like their counterparts in other toolkits.  In the book I’m going to turn this weakness into a strength, by showing you how to extend and customize these widgets to behave precisely the way our users need them to behave.

It doesn’t scale well to larger applications

I’ve read (and maybe even said?) many times that Tkinter is “fine for small apps, but doesn’t scale to big things”.  That may be true depending on your definition of “small” and “big”, but most of us aren’t building Microsoft Office.  The book is going to go through creating a moderately-sized database application that would be pretty typical of in-house software and I’ll be demonstrating techniques to make Tkinter scale.

Exciting times, folks

This is my first experience as an author, so I’m hoping it goes well.  If you have particular aspects of Tkinter you’d like to see covered, let me know!

Project highlight: PyStump

screenshot of pystump

PyStump transitioning between slides.

Yesterday I put up a page for PyStump, a web-based announcements display system.  I started PyStump as a pet project a couple years ago, but only in recent months have I put in the work to make it an actual usable piece of software.  I thought it might be time to highlight it a little. (more…)

Joining Debian 8 to Active Directory

Joining a GNU/Linux machine to a Microsoft Active Directory has been possible for years, but it’s always been a bit of a science project that involved touching half-a-dozen obscure config files and usually resulted in me getting completely locked out of the machine. Various commercial packages such as Likewise and Centrify aimed to smooth out the process, but they weren’t universally accessible across distros, and often produced inconsistent results.

After upgrading a system to Debian 8, I noticed a new option for joining the domain, courtesy of the folks at RedHat: realmd. Realmd puports to make joining an Active Directory domain dead simple. How does it do?

(more…)

WCGBrowser in AUR

As of tonight, WCGBrowser is available from the Arch User repository! Arch Linux users can install “wcgbrowser-git” using their favorite AUR front-end, or by downloading the PKGBUILD directly from the AUR.

Enjoy!

Meet ADMBrowser

It’s been a snowy week like Tennessee hasn’t seen in decades, so with a couple of extra down-days on my hands I decided to work on a project that’s been on my docket for some time: porting WCGBrowser to a new web-rendering engine.

WCGBrowser has been my most popular open-source project by far, and between blog posts I’ve seen and emails I’ve received, it seems to be powering kiosks and signage from New England to the Netherlands, Germany, and Australia. I’ve found it quite useful within my own organization, but it’s Achille’s heel for many years has been QtWebKit.

QtWebKit is, basically, dead, and starting to stink a little. Its performance is slow, it’s buggy with some websites, and it tends to leak memory like a seive. The Qt community has been working for the last couple year to integrate Chrome/Chromium’s Blink browser engine into Qt, and recently with the release of 5.4 this new “QtWebEngine” library is now available for me to play with on Arch Linux.

So I’ve begun porting the browser to QtWebEngine. It became immediately obvious that this was going to break a lot of things in WCGBrowser, and I’ve been wanting to change the name for a while, so I decided to fork WCGBrowser and start a new project.

I give you ADMBrowser.

Yeah, I went full ego on the name. Mostly I just want to avoid a name collision with a commercial browser, since there is a new one being bankrolled by VC every five minutes.

ADMBrowser

So far ADMBrowser is a quick-n-dirty port of WCGBrowser to QtWebEngine, basically discarding any features that couldn’t be easily ported with a search-and-replace. Sadly, that’s a lot of important features so far:

  • Plugin support
  • External File (PDF, etc) support
  • Privacy mode
  • Proxy support
  • Certificate handling

That’s just the quick core-features test findings. I haven’t tried all the more obscure features yet. Needless to say, don’t swap your production rig to ADMBrowser just yet.

Apart from the WebEngine move, I plan to clean up some of the redundant configuration options and maybe organize things a little better. I’ll also be dropping support for Python 2 (or at least not going far out of my way to support it).

Hopefully QtWebEngine will mature quickly, or workarounds will come to light. I can tell already that many rendering and performance bugs from the old WCGBrowser are tidied by by the new renderer.

If you’re Python & Qt coder who might be able to help me fix some of these things, please feel free to fork and submit pull requests.

2015 Desktop Environment roundup

It wasn’t so long ago that picking a desktop environment for your GNU/Linux system was a Coke/Pepsi/RC experience. In recent years, though, we’ve seen an explosion of projects promoting new and interesting options for your graphical environment. Having failed to find a good showcase for the various options, I thought I’d put together a blog post giving a quick summary and some visuals for each option.

(more…)

One year on Arch Linux

About this time last year, I got a bit of an early “Christmas Present”1: A shiny new work laptop. My work laptop is kind of my “daily driver” machine; I use it to study, code, communicate, and keep up with the latest tech trends, which amounts to the majority of what I use a computer for. I’d had my previous laptop for 5 years or so, and to say it was “lived in” was an understatement.

I’ve been using GNU/Linux in one form or another since around 2004/2005, and for the last several years I’ve been installing a fairly heavily-modified Kubuntu for my main machines. I’d replaced KDE with Awesome WM and rigged up a custom desktop experience; my software was a hodge-podge of repo installs, PPA installs, compiled-from-source software, converted RPMs, a few heaven-knows-where-I-found-them proprietary .debs, etc. etc. The thought of recreating my setup from scratch was just not fun.

I’d been getting the feeling that Ubuntu and I were no longer operating on the same wavelength; I was spending a lot of effort to turn Kubuntu into a bleeding-edge, custom-built, minimalist distro, and using half a dozen different methods to do it. By the time the new laptop arrived I’d decided it was time to give Arch Linux a try.

(more…)

Friday Fun: Linux on an old point-of-sale

On the bench today: a mysterious black point-of-sale system recently retired from use at a Parks facility. This victim of the end-of-XP upgrades landed on my desk since it wouldn’t run Windows 7, to see if it could be made useful with Linux.

(more…)

TIL: Finding a row with the max of multiple columns in Postgresql

Part of my job is desigining helper applications around a set of data in a database designed by a third-party software vendor. The vendor’s database design is … interesting to say the least; many of the records are versioned, so a common challenge is to find the newest record for a given entity.
(more…)

« Previous PageNext Page »