Skip to main content

Interactive script utilities

Project description

PyPI

Script utilities

Utility functions for interactive scripts.

Installation

python -m pip install zmunk-ui

Examples

Processing input

from ui import hide_cursor, show_cursor, get_key, Key, clear

hide_cursor()

clear()

while True:
    key = get_key()
    clear()
    match key:
        case Key.RIGHT:
            print("move right")
        case Key.LEFT:
            print("move left")
        case c if isinstance(c, str):
            print("c:", c)
        case Key.EXIT:
            break


show_cursor()

Printing colors

from ui.colors import blue, red_bg

print(red_bg("Error"))
print(blue("Hello, world"))

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

zmunk_ui-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zmunk_ui-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file zmunk_ui-1.0.0.tar.gz.

File metadata

  • Download URL: zmunk_ui-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for zmunk_ui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3f8bea96f5dc39da8b206a48649c8bc381a00f3aba2227b0f903f27ddbcca4e9
MD5 5ad276bfeb047785175382febbd37943
BLAKE2b-256 a0a622e88c49cbc0f04f1ace75320354e916421c29ed499f552a9b63ae14ea58

See more details on using hashes here.

File details

Details for the file zmunk_ui-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: zmunk_ui-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for zmunk_ui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a991749eca831a7e956f207d6765e05511407899e65f34dfd0d2e8a50e1880f
MD5 7998d0c628fdd3b71700180c639a0752
BLAKE2b-256 13d64206dc8e02930a46fb7b52efddad98a4a3fd31dbfd8efd04d039a65a145c

See more details on using hashes here.

Supported by

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