AnsI/O module for ansi input & output
Project description
AnsI/O
AnsI/O module for ansi input & output
Example usage
Ansi input
from ansio import ansi_input, application_keypad, mouse_input
from ansio.input import InputEvent, get_input_event
with ansi_input, application_keypad, mouse_input:
while True:
event: InputEvent = get_input_event()
print(event.pressed, repr(event.shortcut))
Example output:
True 'alt+shift+a'
True 'ctrl+a'
True 'tab'
True 'shift+up'
True 'a'
True 'primary_click'
False 'primary_click'
True 'ctrl+primary_click'
False 'ctrl+primary_click'
Ansi output
from ansio import ansi_output
from ansio.colors import blue_bg, invert, italic, yellow
with ansi_output:
print(f'Print in {yellow(blue_bg("color"))} and with {italic(invert("styles"))}')
Example output:
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
ansio-0.0.2.tar.gz
(27.8 kB
view hashes)
Built Distribution
ansio-0.0.2-py3-none-any.whl
(21.2 kB
view hashes)