Search code examples
pythonncurses

Edit text using Python and curses Textbox widget?


Has anybody got a working example of using the curses.textpad.Textbox widget to edit existing text? This is, of course, in a Linux terminal (e.g. xterm).


Solution

  • I found that the Edit widget in the urwid package is sufficient for my needs. This is not the Textpad widget, but something different. The urwid package is overall nicer, anyway. However, it's still not pain-free. The Edit widget does allow inserting text, but not overwriting (toggled with Ins key), but that's not a big deal.