IngoMeyer441 / simple-term-menu

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

Error with multi_select #70

Closed allenweiss closed 1 year ago

allenweiss commented 1 year ago

When I use this code that was posted as an example of multi-select. I get an error. Note, I used this simple-term-menu with no problems as long as I don't do a multi-select.

TypeError: init() got an unexpected keyword argument 'multi_select'

from simple_term_menu import TerminalMenu

def main(): terminal_menu = TerminalMenu( ["dog", "cat", "mouse", "squirrel"], multi_select=True, show_multi_select_hint=True, ) menu_entry_indices = terminal_menu.show() print(menu_entry_indices) print(terminal_menu.chosen_menu_entries)

if name == "main": main()

IngoMeyer441 commented 1 year ago

Thanks for your report. I tried the example and it works for me. Do you perhaps use a quite old version of simple_term_menu? Multi-select was added in version 0.11.0 and the latest version is 1.5.2. You can check the installed version with:

python -c 'from simple_term_menu import __version__; print(__version__)'
allenweiss commented 1 year ago

Thanks..I guess I'm running 0.10.4...so how do I update to the latest version?

IngoMeyer441 commented 1 year ago

Did you install with pip? In this case

python3 -m pip install -U simple_term_menu

should do the trick.

allenweiss commented 1 year ago

Thanks so much...that worked....really like the plugin.