IngoMeyer441 / simple-term-menu

A Python package which creates simple interactive menus on the command line.
MIT License
492 stars 43 forks source link

Have a separator between the entries #45

Closed svartkanin closed 2 years ago

svartkanin commented 2 years ago

Is there a way to have a separator between entries? For example to have a menu that looks like

entry1
entry2

add
edit

I can currently only achieve that but adding an entry with a space in it but then then when iterating through the menu it is part of the selection.

from simple_term_menu import TerminalMenu

def main():
    options = ["entry 1", "entry 2", " ", "add", "edit"]
    terminal_menu = TerminalMenu(options)
    menu_entry_index = terminal_menu.show()
    print(f"You have selected {options[menu_entry_index]}!")

if __name__ == "__main__":
    main()

However, it would be great to have a separator between menu entries that is not part of the menu itself