# The Python X Library

# Introduction

The Python X Library is a complete library for writing X Windows client applications in Python. It implements the entire X11R6 protocol and some extensions, and also some supplementary functionality such as a resource database. It is written entirely in Python, and is therefore entirely independent of the traditional C Xlib; it only requires a Python installation with network support.

Although the X11R6 protocol is the basis of all X client applications, it is a little too low-level to be useful for writing advanced graphical interfaces. To this end, many different widget sets has been developed, a few of the more popular are Motif, Qt and Gtk. The Python X Library is not compatible with any of these, as they are based on the C Xlib. As a result the Python X Library isn’t in itself very useful for writing GUIs, but is eminent for writing small X applications with no advanced GUI, e.g. simple monitor programs, or for that matter more advanced background applications such as window managers.

## Table of Contents

- 1 Basic X Concepts
- 2 Package Layout
- 3 Connect to a Display
  - 3.1 Unix Display Names
  - 3.2 OpenVMS Display Names
- 4 Error Handling
  - 4.1 X Error Classes
  - 4.2 CatchError
- 5 Event Handling
  - 5.1 Getting Events
  - 5.2 Selecting Events
  - 5.3 Event Types
  - 5.4 Sending Events
- 6 X Objects
  - 6.1 Display
  - 6.2 Resource
  - 6.3 Colormap
  - 6.4 Cursor
  - 6.5 Drawable
  - 6.6 Window
  - 6.7 Pixmap
  - 6.8 Fontable
  - 6.9 GC
  - 6.10 Font