PyZenity is an easy to use interface to Zenity for Python. Zenity is normally called from scripts by invoking it with a multitude of command line parameters that it uses to construct its interfaces. This module hides the details of invoking the command and presents simple API functions like:
cancel = Question('Should I cancel the operation?')
Why PyZenity?
Well I originally wrote PyZenity a few years ago when I decided I wanted to learn how to use the new (in Python 2.4) subprocess module. Now I needed a command that I could use to experiment with and I thought, “hey, what better program then Zenity.” It takes lots of parameters, has well defined return values, and I could experiment right from the interactive shell because it spawned a GUI. So I wrote functions to call Zenity’s widgets and played around for a bit exercising some of the features of subprocess. When I was done I thought, “Maybe someone would be interested in this”, so I documented it and threw it up on my website. Lo and behold, a few people were and I occasionally get bug fixes for it.
Others have noted that the proper thing to do is use PyGTK to create interactive GUIs and I totally agree. But if your interest is in creating quick scripts to get the job done, PyZenity is much easier to use.
Note for Windows Users: PyZenity appears to work out of the box with the Windows version of Zenity here.
Download
The current version is 0.1.8.
- PyZenity-0.1.8.tar.gz – md5sum: d2043a9c1cca4fb895af22b91d0a1dde
- PyZenity-0.1.7.tar.gz – md5sum: dcacadafafaa1d71abfec06805936aef
- PyZenity-0.1.6.tar.gz – md5sum: e7ad49e01d701937b32701951a2db9b1
- PyZenity-0.1.5.tar.gz – md5sum: 9b7634b27d3fee070ac609847343224b
- PyZenity-0.1.4.tar.gz – md5sum: 46b0773dd048ff8e5742c7758b3041b0
- PyZenity-0.1.3.tar.gz – md5sum: ce2d48c5e17bf50ff110f6a08fa327e2
- PyZenity-0.1.2.tar.gz – md5sum: 3b5a724738d2bfd6b1ed084eaab6fe09
- PyZenity-0.1.1.tar.gz – md5sum: f25d8e33c3efbafe7a99780e0c7603a7
- PyZenity-0.1.tar.gz – md5sum: 8ed62a9222774b0bc04c21f351e19a5c
Documentation
The documentation is available here.
Release Notes
- Version 0.1.8 – Austin Green sent in a patch to add missing options and streamline an internal dictionary.
- Version 0.1.7 – Shane Mclafferty pointed out that there is no “ok-label” and “cancel-label” parameters. Added an optional “ok_label” and “cancel_label” parameters to remedy this.
- Version 0.1.6 – Ben suggested that the GetDate function return a 4 digit year to make life a whole lot easier.
- Version 0.1.5 – Adds kwargs to functions to specify optional Zenity parameters like height, width, etc.
- Version 0.1.4 – Dietmar Thaler fixed a
ValueError
bug in PyZenity.List when using theboolstyle
parameter. - Version 0.1.3 – The PKG-INFO file says PyZenity is under the BSD License but it’s actually under the MIT License. Thanks to Siegfried-Angel for pointing that out!
- Version 0.1.2 – Felix Hummel found and fixed an ImportError when using the GetDirectory function caused by a failure to import os.path.
- Version 0.1.1 – Fixed a bug with the GetDate function not taking into account locale while parsing the return from zenity. Thanks to Matt Williams for finding the bug.
- Version 0.1 – Initial version.