a useful library that allows the user to select between multiple items in the console using the keyboard. Supports very long lists that don't fit on the screen, rich styles, control with buttons up
, down
, left
, right
, wasd
, j
, k
, home
, end
, page up
, page down
- installation
- usage
- print text while choosing
- rich styles support
- long items list support
- page size
- supported buttons
- changelog
- license
installation^
pip install easyselect
usage^
from easyselect import Sel
yes_or_no = Sel(
items = [
'yes',
'no',
]
)
answer = yes_or_no.choose()
print(answer)
print text while choosing^
yes_or_no = Sel(
items = [
'yes',
'no',
],
text = 'please select yes or no'
)
rich styles support^
linux only
yes_or_no = Sel(
items = [
'yes',
'no',
],
styles = [
'green',
'red'
]
)
very long items list support^
nums = Sel(
items = list(range(50))
)
page size^
page_size arg allows to specify how much lines will be rendered on screen
default value is 15
nums = Sel(
items = list(range(50)),
page_size = 3
)
supported buttons^
user will able to use these buttons
- up, down, left, right
- w, a, s, d, j, k
- home, end
- page up, page down
changelog^
you can read changelog here