Skip to main content

A lightweight POSIX terminal I/O library

Project description

ltermio - A Lightweight POSIX terminal I/O library

The package contains four modules: cursor, termkey, color256 and unicon. Tested only on MacOS terminal and iTerm2, so the platform compatibility has not been well verfied yet. All functions are based on CSI sequences or termios, no additional requirements other than the standard library.

New: Added a new module termouse, ready to support mouse base on XTerm extension...Roughly implemnted.

Installation

Uses pip to install the package:

pip3 install ltermio

cursor

A series of functions about screen and cursor operations. And additionally provides 4 interesting functions for text composing, where v_composing() supports using VI like cursor commands to layout text display.

termkey

There are 5 curses like functions: getch(), getkey(), ungetch(), ungetkey(), setparams().

getch() and getkey() read keyboard in non-canonical mode, ungetch() and ungetkey() put keys back to the key buffer for next reading, setparams() sets frequently-used input attributes.

termouse

Roughly implemented mouse supporting.

color256

Sets 256-color display attributes of the character terminal.

unicon

Collection of some common icons in unicode character set.

References

https://en.wikipedia.org/wiki/ANSI_escape_code https://www.xfree86.org/current/ctlseqs.html https://www.leonerd.org.uk/hacks/fixterms/

History & Why

When I was learning Python a few months ago, I decided to write a terminal Tetris game as a practice of the language learning. Due to the learning reason, I did not want to use any third-party packages. So when I finally finished the game, there naturally formed this by-product, I named it ltermio.

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

ltermio-0.4.6.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

ltermio-0.4.6-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file ltermio-0.4.6.tar.gz.

File metadata

  • Download URL: ltermio-0.4.6.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ltermio-0.4.6.tar.gz
Algorithm Hash digest
SHA256 650b3d7a6fbdbe0dcffed921271e59e4d1fb98362036d087c1a55e4aae3d6ff4
MD5 79aa25b3c8ba96e457bc2f8e75a33efa
BLAKE2b-256 18e7a221f8cfcfe8b01cd0ed4e027c19239177120be42610363e403b86d7a2d6

See more details on using hashes here.

File details

Details for the file ltermio-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: ltermio-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for ltermio-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ac1fef0689a53dd7cdce9c080df666bb7c6e7371d16b30aec9326a074c115a61
MD5 18ce812d5c6762b2b1d89d0cbe5d9158
BLAKE2b-256 4ce2e0c970f6a87fd527f649535a6168c5e9686362c336e212a4f88c33dca81a

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