Urwid, a Console UI library for Python
[Posted February 22, 2006 by cook]
Urwid
is a terminal-based user interface library for the Python language
that is reminiscent of the old Unix
curses
terminal control library. Urwid is used for implementing
user interfaces that work with simple ASCII terminals.
The basic Urwid feature set includes:
- A list box mechanism with support for scrolling.
- An edit box for entering and modifying text.
- Pushbutton, check box, and radio button widgets.
- Simple character-style graphical capabilities.
- The ability to adapt to a dynamically resizeable terminal window.
- Support for capturing the screen.
- Support for embedded tables of widgets.
- Support for UTF-8, 8 bit ASCII, and other character encodings.
- Includes a text attribute markup language.
- Support for multiple text alignment and line wrapping modes.
- Support for user-defined text layout classes.
- Support for a web-based Apache/CGI display mode.
- Runs on Linux, OSX, Cygwin-based, and other systems.
Urwid documentation is thorough, an online
Reference Manual
explains the programming interface and the online
Tutorial gives some
example uses of the software.
There is also an online web_display module
live demo site for those
who wish to test Urwid in action.
Installation
is quite simple, packages are available for Debian-based systems,
and a simple setup.py script is provided for other
platforms. A number of useful demo programs are included for
testing and reference. Demos include a directory browser, a numerical
calculator, a text editor, a test suite, a fibonacci generator
and a package tour, see the
screenshot and programming examples for some images.
Your author was able to run all of the demos
with no trouble.
Version 0.9.0 of Urwid
was released
this week:
"This is the first release of Urwid with UTF-8 input and display support.
A new raw_display module was added to enable UTF-8 display. This module
also fixes the "dead corner" in the bottom right of the screen and
improves legibility of bright text in some terminals."
Urwid is a useful tool for applications that need the portability offered
by a text-only user interface, it fills a void between full-fledged
GUI applications and a simple command line interface. Being Python-based,
it is portable, easy to install, and simple to use.
(
Log in to post comments)