Example Programs

These example programs may be found in the examples directory of your Urwid distribution.

tour.py

../_images/tour1.png ../_images/tour2.png ../_images/tour3.png

Show how many of the standard widgets may be arranged on the screen, including a DropDown with its list open

graph.py

../_images/graph2.png

Demonstrate BarGraph widget and alarms used for animation

edit.py

../_images/edit1.png ../_images/edit2.png

A simple text editor with lazy loading

browse.py

../_images/browse2.png

A lazy directory browser with file selection, tree-view, custom widgets and list walker

subproc.py

../_images/subproc1.png ../_images/subproc2.png

Monitor and display results from a subprocess

calc.py

../_images/calc3.png ../_images/calc4.png ../_images/calc5.png ../_images/calc6.png

A calculator with a decimal and a programmer tab over one display of big digits, which carries the number shown to the selected tab. It takes numeric keypad input, and has a theme pop-up that previews the palette until OK or Cancel, and a help dialog. The calculator logic is plain Python, kept apart from the user interface in the same file

notifications.py

Messages of each severity in the footer of a window, each one dismissed after five seconds, and a message that stays until it is dismissed

spinner.py

A spinner for every frame preset, started, stopped, stepped and sped up together

external_editor.py

Hand the terminal to an external editor and show the text written in it

thread_worker.py

Run a slow computation on a worker thread and show its progress and result

palette_test.py

../_images/palette_test2.png

Show available colors in various screen modes

bigtext.py

../_images/bigtext2.png ../_images/bigtext3.png

demonstrate the BigText widget