A basic module to embed a terminal-like input in Python applications
Project description
embed-term
A basic module to embed a terminal-like input in Python applications.
Features
- Terminal-like input handling with cursor control
- Cross-platform support (Windows, Linux, macOS)
- ANSI escape code support for text formatting
- Raw character input processing
Installation
pip install embed-term
Usage
from embed_term import EmbedTerminal
# Create a terminal instance
terminal = EmbedTerminal()
# Initialize the terminal
terminal.init_terminal()
# Read user input
terminal.tick()
# Display input
terminal.display_input()
# Reset terminal
terminal.reset_terminal()
API
EmbedTerminal
Main class for handling terminal-like input.
Methods
init_terminal()- Initialize the terminal for raw inputreset_terminal()- Reset the terminal to normal moderead_input()- Get the current input as a stringdisplay_input(type="sl")- Display input with prompt"sl"- Single line display (default)"nl"- New line display"er"- Erase display"cl"- Clear and redisplay
clear_input()- Clear the input buffertick()- Process one character of input
License
MIT
Author
Glenn Sutherland
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
embed_term-0.1.2.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file embed_term-0.1.2.tar.gz.
File metadata
- Download URL: embed_term-0.1.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
997acb8876a1d5a76a30a4eb25571d59600f56dad36677dccf1d8cd6ba93211d
|
|
| MD5 |
7f1a5f7378f1afa2ff35d86c7f6ccf7f
|
|
| BLAKE2b-256 |
feb5138ef9d92fead4cd38537e9272e847c74b944d917f53fe661f4b907fbe47
|
File details
Details for the file embed_term-0.1.2-py3-none-any.whl.
File metadata
- Download URL: embed_term-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfedd03312d8e2abe4cdff199acd86a6188ce8823aa0ed3ed8604f963af97968
|
|
| MD5 |
3e8e08bc32265469fac24a09811d5f52
|
|
| BLAKE2b-256 |
2ebfc70c2e3628831c640fe2b40d1f04d01c3988a6e87a29d35178b3328a28a7
|