A python library to create curses based CLIs.
from cursesinquirer import CursesInquirer, Select
# Define your program
def program(ci):
tasks = ["Say hello", "Exit"]
task = ci.ask(Select("What do you want to do?", tasks))
if task == tasks[0]:
print("Hello!")
elif task == tasks[1]:
exit(0)
# Run your program in a Curses Inquirer context.
CursesInquirer(program)
More examples available in examples folder.
The builtin question components does not have a lot of customizability options. That said you can create your own to suite your needs. Create a class that inherits from the abstract base class Question and implement the necessary methods.
See issues.
Here is a list of similar libraries that have been an inspiration to this library and might fit your needs better.
MIT, see LICENSE file.