Skip to main content

A configurable curses text editor window

Project description

py_curses_editor

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

Other Contributors:

Features

  • 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 3+

Installation

  • # pip install py_curses_editor OR
  • $ pip install --user py_curses_editor OR
  • $ pip install --user -e . (install from local git clone for development)

License

  • MIT

Usage

From non-curses application:

import editor.editor as e
e.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

Key Action
F1 Show popup help menu
F2 or Ctrl-x Save and Quit
Enter Enter new line, or Save and Quit in single line mode
F3, Ctrl-c or ESC Cancel (no save)
Cursor keys Movement
Ctrl-n/p Ctrl-f/b Up/down right/left
Home/End Ctrl-a/e Beginning or End of current line
PageUp/PageDown PageUp/PageDown
Delete/Ctrl-d Delete character under cursor
Backspace/Ctrl-h Delete character to left
Ctrl-k/u Delete to end/beginning of-line
Ctrl-v Paste a block of text from primary clipboard (requires xclip or xsel)

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_curses_editor-1.3.2.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

py_curses_editor-1.3.2-py2.py3-none-any.whl (13.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file py_curses_editor-1.3.2.tar.gz.

File metadata

  • Download URL: py_curses_editor-1.3.2.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for py_curses_editor-1.3.2.tar.gz
Algorithm Hash digest
SHA256 b9469c5a4f0142271b90fe679bf31f6b0209cf44eb395cb7df2be98d049bc09e
MD5 2f344a2e14974f18bbf4a8eb883ea0e5
BLAKE2b-256 8d84f873c4ad0335f7f84111e1d0b90b3344099177b6d9e8695453e7b798e439

See more details on using hashes here.

File details

Details for the file py_curses_editor-1.3.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for py_curses_editor-1.3.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2a24dbbade4a64bfb3d8c60ab9412b99a9e6120a92f6710b710442f1fc195fe2
MD5 ecfb02ab5ba3b00e05d675b3f243a7c9
BLAKE2b-256 63ba79ae3296f01eb5cce4b1c67342be914d4905bc52344acd7266036295598a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page