With EasyGUI, I Can Stick with Python

Well, that's the best pun I could come up with but EasyGUI looks like the missing link that makes Python my first choice where I tended to use Bash.

For all of recent history, I have used dialog for basic interaction with users. Dialog is a program callable from the shell that produces an assortment of not pretty but functional interaction boxes. Anyone who has installed Debian or any of its derivatives knows what they look like.

On the other end of the spectrum is QT, the GUI builder behind KDE. It is pretty, elegant, adaptable and, well, something that requires you to write (or generate) C++ code.

While Python tends to be my language of choice, it has always been a pain for tasks I have done with dialog and shell scripts. The reason is that the standard Python tools for doing GUIs do more than I generally want. Tkinter is a good example. It will do what I want but it requires writing an event-driven program and knowing more about Tk than I really want to know. Well, enter EasyGui. If you are familiar with using dialog, the best description of EasyGui is that it is dialog except it is activated by Python calls rather than shell commands. For the rest of you, this is from the EasyGui web page.

EasyGui provides an easy-to-use interface for simple GUI interaction with a user. It does not require the programmer to know anything about tkinter, frames, widgets, callbacks or lambda. All GUI interactions are invoked by simple function calls that return results.

I was going to write some of the typical stuff like how to write Hello World using EasyGui but this stuff is all pretty obvious. It is, well, easy. Where to use EasyGui, however, is worth mentioning.

In the past few years I have written web applications to perform a task because it is relatively easy to put together a form for user input and produce decent-looking user output. In many cases, however, I had no need for the web interface—the application was running locally. While the application was easy to write, the need for a web server and telling the user that they needed to use a browser to run the program was an unnecessary complication. EasyGui seems to be the perfect "right way" to write these types of applications.

______________________

Phil Hughes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

QT

Alan's picture

While I'm sure EasyGUI is great, I think you misrepresent other toolkits. I use PyQT quite a bit, and I never have to write C++ code in order to use it. If EasyGUI works for you, so much the better, though it's unfortunate to perpetuate people's fear & dread of more complete GUI toolkits.

Different Game

Phil Hughes's picture
Fear and dread is one thing, a tool similar to Dialog to get a particular class of work done is quite different. PyQT is a great package that offers the power to QT to the Python programmer.

But, a quick look at the PyQT info on the Python wiki I believe makes my point. It says:

PyQt implements around 300 classes and over 5,750 functions and methods

Back when you would regularly see, for example, posts by Dennis Ritchie in the Usenet newsgroups, elegance in solving problems tended to emphasize using the least powerful (which usually also meant the smallest and/or fastest) tool to solve the problem. I assert that EasyGUI is the more elegant tool for the class of problems I suggest.

Those of us who would prefer to write Python rather than C++ appreciate that others too the time to write PyQT. That said, it is still a different type of tool much like Qt itself is a different tool than curses.

Phil Hughes

What pun?

theillien's picture

I don't get it.

GUI ~ gooey

goblin's picture

GUI pronounced like "gooey" -> "Stick with Python"

gooey:
http://www.merriam-webster.com/dictionary/gooey

That's the pun I can see, but English is not my first language, so I could be missing the real pun.

I still don't get it

theillien's picture

I'm not sure there is even a pun there.

Very punny.

Anonymous's picture

Very punny.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState