pygame_display is an implementation of the urwid display system for PyGame, making urwid usable on non-Unix OSes.


  • Windows support
  • Keyboard and mouse support, including "mouse drag"
  • 8-bit color palettes (pygame could do 24-bit color palettes, but Urwid lacks the API for this!)
  • Customizable window titles and starting resolution

Getting Started

If you do not know how to use Urwid, please consult the Urwid documentation before you try to use pygame_display.

If you do, the only difference between using pygame_display and another display for running urwid-based applications is that you specify your screen to be pygame_display.Screen() instead of the default screen (raw_display.Screen()). For concrete examples, a couple of the Urwid tutorial programs were modified in this way and can be seen in the examples/ subdirectory.

Wince urwid runs on pygame, it is additionally possible to run urwid inside a pygame application, and embed an urwid console inside your game. So far this is a bit painful, but see examples/ for an example of how to do it. For an example of how to use pygame_display only when on Windows, and raw_display otherwise, see examples/

Please keep in mind that this module is new, and written by a non-Urwid-user. I'm sure that bugs are present, some of them even due to misunderstandings of how urwid is meant to work. I welcome any helpful advice and bug reports.

Using pygame_display on Microsoft Windows

As mentioned before, Urwid+pygame_display can run on Windows, but only if you comment out the imports for the modules pty, termios, and fnctl. A fork of urwid that works on Unix as well as Windows is available at this address:

Since the required changes are very small, hopefully this or a more structured change will make its way into Urwid's main repository, so that Windows support exists out of the box.

So does this mean I can use existing Urwid apps on Windows?

Since pygame_display is not the default screen (the Unix-only raw_display is), apps will not work on Windows without slight modifications. However, as proof-of-concept the (minimum) necessary modifications have been made to the popular urwid-using application bpython and pudb.

Contacting the author

I will pay close attention to bug reports filed on bitbucket. I am also available on IRC, via the nickname "ssbr". You can find me on Freenode's #python and OFTC's #urwid.