7

I have a few small scripts that I use for routine tasks. They require simple parameters to run. Rather than running them from the terminal, I'd prefer to pick something from the menu, be presented with a simple window with fields to input the parameters, click a "Go" button and have the script run. I've looked at descriptions of GTK+, Qt, etc, but I'm not really sure where to start.

I want:

  • a really simple framework
  • preferably with a Python API
  • that I can ideally create GUIs for programatically (e.g. define 5 input objects in the code, and five fields appear in the window, nothing more required - this is so that I can add and remove parameters/fields on a whim)
  • it would be nice to have both text fields and dropdowns, but text fields will do
  • to be able to provide simple feedback for validation and confirmation
  • to be future proof against both Unity and Gnome Shell
  • a simple tutorial on creating an app with this framework (again, preferably in Python)
6

Really the way to go overall for user friendly GUI app development is Quickly. It gives you a workflow and several helper scripts to get you up and running fast and easy. It is however very opinionated on the software to use, eg for GUI it uses PyGTK.

My own experience from looking into the Python GUI frameworks is that there is no single best one. Some say wxPython is the way to go, others PyQT. However I believe a lot of the Ubuntu specific software is done using PyGTK.

2

There is zenity Install zenity for example.

As far as I know it does not provide a Python API but you can very easily configure the dialogs using its command line options. In fact it is actually meant for use in shell scripts but I don't see any reason to not use it in conjunction with Python.

For more information on all of its options I'd like to point you to the Zenity man page.

Here is a simple example on how to use it from a shell script.

This is only if you don't want to go with a more sophisticated solution. In general I'd recommend Quickly.

0

You can use gdialog from your shell scripts and they will became GUI -> man

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.