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.4.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.4.tar.gz.
File metadata
- Download URL: embed_term-0.1.4.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 |
dedb8e172f4828e7a1958f5619b90d91a01a506e43670c52b3fece46b1a00fa1
|
|
| MD5 |
05b76fa3c85a929da48e449f8c8d1b8d
|
|
| BLAKE2b-256 |
91d70ef83cb6aef7b0fe3bf9cbd54f59e0404df6102fa8216f8a8a5266fef426
|
File details
Details for the file embed_term-0.1.4-py3-none-any.whl.
File metadata
- Download URL: embed_term-0.1.4-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 |
df97326279c5cb972e9d761b09dfb35be0e9b829f0ce0d23da3e04b047e75d9a
|
|
| MD5 |
067baeb81b9f0d6527413a7e6c23c40b
|
|
| BLAKE2b-256 |
0b291fb17438089304a8175b34b840f66990a2d1cafcfbfacfd547fd5402aefd
|