DEV Community

MrRobot
MrRobot

Posted on

Urwid – Console User Interface Library for Python

Urwid is a Python library for creating rich, interactive text-based user interfaces (TUIs) in the terminal. It supports widgets, colors, mouse interaction, and even complex layouts — making it ideal for building terminal dashboards, text editors, or configuration tools. Urwid helps you create visually appealing and responsive interfaces entirely within the command line.


Installation:

pip install urwid
Enter fullscreen mode Exit fullscreen mode

Example usage:

import urwid

def on_exit(button):
    raise urwid.ExitMainLoop()

text = urwid.Text("Hello, Urwid!")
button = urwid.Button("Exit")
urwid.connect_signal(button, 'click', on_exit)

pile = urwid.Pile([text, button])
fill = urwid.Filler(pile, valign='middle')

loop = urwid.MainLoop(fill)
loop.run()
Enter fullscreen mode Exit fullscreen mode

PyPI page: https://pypi.org/project/urwid/
GitHub page: https://github.com/urwid/urwid


3 Project Ideas:

  1. Build a terminal-based chat or messaging client.
  2. Create a text-based system monitoring dashboard.
  3. Develop an interactive CLI menu system for server management.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.