Overview Section

  1. What is PyUI?
  2. Why another User Interface library?
  3. Wont python be too slow?

What is PyUI?

PyUI is a user interface library written entirely in the programming language python. It has a modular interface to drawing two-dimensional primitives that can be implemented easily on differing rendering platforms. Currently, PyUI can be used with

Why another User Interface library?

There are many existing and mature user interface libraries. Why another one? Aren't we past the point of re-writing the list box one more time? Why bother with PyUI?

PyUI is implemented entirely in Python. Almost all of the existing user interface libraries are implemented in C or C++. The advantages of a pure python implementation are numerous. PyUI is truly portable across platforms as there is no C code to be compiled. It will run anywhere there is a python implementation and a renderer.

PyUI is fully extensible in python - as all the widgets and event are python objects, they can be extended and customized completely in python. There is no need to worry about there being some portions of code in another language that you cannot modify. Python is a high level language that encourages rapid development. All of the usual arguments for the use of python apply directly to PyUI.

One of the original requirements of PyUI was to be able to draw widgets on top of 3D scenes that use 3D acceleration hardware using OpenGL or Direct3D. This was achieved with PyUI's renderer interface which abstracts the drawing of widgets into 2D primitives that are easy to implement on different rendering environments. PyUI is an ideal user interfaces for 3D applications.

Wont python be too slow?

Another very common question about PyUI is "wont python be too slow to run a UI?". Well, the answer appears to be a resounding no. This was something that concerned me when I began PyUI development but in general hasn't been a problem. With hardware accelerated graphics in a 3D environment, PyUI appears to be "fast enough" even when there is quite a lot of UI going on. The basic PyUI event loop is very light weight. There are a few cases with are computationally intense such as resizing extremely complex windows, but in general actually drawing the widgets is slower than the python code that manages them.

If speed is of serious concern then there are tricks in the rendering interface to allow renderers move much of the drawing code out of python and into non-interpreted languages such as C or C++.

For a detailed examination of python in 3D environments see the Beyond paper.


(C) Sean Riley 2002