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:
- Yuri D'Elia wavexx@thregr.org (Unicode/python2 code from tabview)
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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9469c5a4f0142271b90fe679bf31f6b0209cf44eb395cb7df2be98d049bc09e |
|
MD5 | 2f344a2e14974f18bbf4a8eb883ea0e5 |
|
BLAKE2b-256 | 8d84f873c4ad0335f7f84111e1d0b90b3344099177b6d9e8695453e7b798e439 |
File details
Details for the file py_curses_editor-1.3.2-py2.py3-none-any.whl
.
File metadata
- Download URL: py_curses_editor-1.3.2-py2.py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a24dbbade4a64bfb3d8c60ab9412b99a9e6120a92f6710b710442f1fc195fe2 |
|
MD5 | ecfb02ab5ba3b00e05d675b3f243a7c9 |
|
BLAKE2b-256 | 63ba79ae3296f01eb5cce4b1c67342be914d4905bc52344acd7266036295598a |