Questions tagged [urwid]

Urwid is a console user interface library for Python. It runs on Linux, OSX, Cygwin or other unix-like OS and supports hooking into alternative event loops (AsyncIO, Twisted, GLib).

Urwid is a library for writing console user interfaces. You can see here examples of what's possible.

It offers an alternative to using Python’s curses module directly and handles many of the difficult and tedious tasks.

It comes with several widgets ready to use and it also offers ways create your own widgets, and makes it easy to handle input, terminal resizing and even supports mouse events.

Some applications built with Urwid:

  • pudb - console-based graphicale Python debugger
  • speedometer - tool for measuring the rate of data across a network connection
  • usolitaire - console-based solitaire clone

See more applications built with Urwid in the website list.

Some useful questions

How to create custom widgets

136 questions
4
votes
1 answer

how to update a Columns widget on urwid

I am starting to use urwid and one of the simple things I want to do is have two columns and being able to update one of the columns to display a different widget I tried the following code but I keep getting an error urwid.container.ColumnsError:…
academo
  • 118
  • 6
4
votes
1 answer

Pulling content from a selected item in a ListBox (urwid)

I'm making a ListBox in urwid where each item is a URL pulled from a list of URLs. When an item is selected and ENTER is clicked, I'd like to pull the URL and open it in the browser. Here's my code so far: class SelectableText(urwid.Text): def…
4
votes
2 answers

preferred method to dynamically change the urwid.MainLoop widget

I was looking over a bit of code rooted in urwid: import urwid from functools import partial from random import randint class State(object): def __init__(self, main_widget): self.main_widget = main_widget def…
anon01
  • 10,618
  • 8
  • 35
  • 58
4
votes
1 answer

How to put a urwid.BigText into a urwid.ListBox

I keep getting an error AttributeError: 'BigText' object has no attribute 'rows' when trying to have a BigText at the top of a ListBox. I understand that the BigText is a "fixed" widget, while ListBox expects a "flow" widget, but I can't seem to get…
mcw
  • 465
  • 1
  • 4
  • 14
4
votes
1 answer

Urwid keyboard triggered popup

I'm trying to display a help dialog over top my urwid application when a user presses the H key, but I can't seem to get it to go away. It displays without a problem. What am I missing? I've been at this for the good part of an entire day now. I've…
bkvaluemeal
  • 428
  • 1
  • 9
  • 23
4
votes
1 answer

Urwid horizontal menu - return to previous state or restart loop

I'm building an app based on the Horizontal Menu example from Urwid. I have an item that I want to show some information. I have an "OK" button underneath, and I want it to either pop the menu back to the previous state, or maybe restart the entire…
Arnon
  • 2,237
  • 15
  • 23
4
votes
1 answer

How to update displayed text in urwid?

Got confused with urwid. By adapting one of the urwid examples I get initial screen and would like to execute run_stuff() function when F5 key is pressed and also display message indicating that run_stuff() is running and eventually finished…
Ninius86
  • 295
  • 6
  • 14
4
votes
1 answer

Python Urwid issues with set_alarm

I'm having issues with set_alarm using the library urwid. Basically, when you run it and hit enter on Chapman you will get the error below. I don't know much about urwid, and it seem sto lack documentation and I tried to look for examples to compare…
user4709416
4
votes
0 answers

how to change the ui on urwid

I am creating a small urwid app for my use, the structure is a Filler which has a Pile composed of several Text filed, followed by a Divider, an Edit, another Divier and finally a Text: Text1 Text2 Text3 Divide >> Edit Divide Textout Now, I want to…
Yotam
  • 10,295
  • 30
  • 88
  • 128
4
votes
1 answer

urwid - output screen for endless loop

I'm trying to make a simple urwid an output screen for an endless loop. It needs to output data coming from another class. The solution I've found right now is: have a Printer class (a test replacer for the actual outputting class) with a queue…
user3725459
  • 414
  • 3
  • 9
4
votes
1 answer

Python: urwid: trying to handle different views

I am trying to write a program with different views. I tried to make a class which handles different views with urwid, also to separate the view code from the rest. But after a lot of different tries, i don't know where to start anymore. Which urwid…
3
votes
2 answers

Create horizontally and vertically scrollable table inside Terminal application with Python Urwid/NCurses

I want to create a Terminal application which displays a table with lots of columns and rows (not fitting on a regular screen in width and height). The user should be able to scroll across the table horizontally and vertically (and the rows should…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
3
votes
1 answer

How to make a chat like UI using Python Urwid?

I alreay can implement chat daemons using gevent and zeromq, but I'd like to make a console UI for them. My first attempt with ncurses failed, so I tried Urwid and found out that the project nigiri was going exactly what I wanted: I studied the…
Bite code
  • 578,959
  • 113
  • 301
  • 329
3
votes
1 answer

How can I create an asynchronous program with urwid and asyncio?

I want to build a chatroom with aiortc. Frist of all, I want to build a mockup with urwid as cli and asyncio. The urwid part is already running fine, user input is possible. I know want to run a coroutine that generates random text and works as chat…
aJazz
  • 115
  • 8
3
votes
2 answers

How to indicate that a urwid listbox has more items than displayed at the moment?

Is there a way to show a user that a urwid listbox has additional items above / below the dispalyed section? I'm thinking of something like a scrollbar that gives an idea of the number of entries. Or a separate bar at the top / bottom of the list…
AFoeee
  • 731
  • 7
  • 24
1
2
3
9 10