FunctionItem
Bases: cursesmenu.items.ExternalItem
A menu item that executes a Python function with arguments.
- Parameters:
text (
str
) – The text of the itemfunction (
Callable
[...
,Any
]) – A function or lambda to be executed when the item is selectedargs (
Optional
[list
[Any
]]) – A list of poitional arguments to be passed to the functionkwargs (
Optional
[dict
[Any
,Any
]]) – A dict of kwargs to be passed to the functionmenu (
Optional
[CursesMenu
]) – The menu that this item belongs toshould_exit (
bool
) – Whether the menu will exit when this item is selected
Call the function with the provided arguments.
- Return type:
None
Get the returned value from the function.
- Return type:
Any
- Returns:
The value returned from the function, or None if it hasn’t been called.