Configurable curses text editor class
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
editor
tests
.gitignore Major update to v 1.1.0 Feb 9, 2015
.travis.yml
CHANGELOG.rst
LICENSE.txt
README.rst Added paste from primary clipboard for larger blocks of text using xs… Feb 18, 2015
setup.py

README.rst

py_curses_editor

Python curses text editor module. Provides a configurable pop-up window for entering text, passwords, etc.

Posted by Scott Hansen <firecat4153@gmail.com>

Other Contributors:

Features:

  • Python 2.7+, 3+
  • Unicode support
  • Configurable window size and location
  • Text box can have a title and/or an outlined box
  • Text box can be initialized with existing text to edit
  • Password mode for hiding text entries
  • Paste in large blocks of text from primary clipboard
  • Pop-up help menu

Requires:

Python 2.7+, 3+

Installation:

  • # python setup.py install OR
  • $ python setup.py install --user

License:

  • MIT

Usage:

From non-curses application:

import editor
editor.editor(box=False, inittext="Hi", win_location=(5, 5))

From curses application with a predefined curses window object (stdscr):

from editor.editor import Editor
Editor(stdscr, win_size=(1,80), pw_mod=True, max_text_size=1)()

Keybindings:

Notes:

Using shift-insert to paste text will be quite slow, as it's pasting one character at a time. Use Ctrl-v to paste a large block of text from the primary clipboard.

Double-width characters are not yet supported.