Skip to content

Commit

Permalink
add filter_list callback example
Browse files Browse the repository at this point in the history
  • Loading branch information
badranX committed Feb 13, 2025
1 parent e35c32c commit bd0d8d6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/filter_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ def filter_func(text, collection):
return list(g)


def callback_listener(item):
with open('choice_logs.txt', 'a') as f:
f.write(str(item) + '\n')


questions = [
inquirer.FilterList(
"size",
"food selection",
message="Select item ",
choices=choices,
carousel=False,
filter_func= filter_func,
filter_func=filter_func,
choice_callback=callback_listener
),
]

Expand Down

0 comments on commit bd0d8d6

Please sign in to comment.