FunctionItem

Bases: cursesmenu.items.ExternalItem

class cursesmenu.items.FunctionItem(text, function, args=None, kwargs=None, menu=None, should_exit=False)

A menu item to call a Python function

Variables:
  • function – The function to be called
  • args (list) – An optional list of arguments to be passed to the function
  • kwargs (dict) – An optional dictionary of keyword arguments to be passed to the function
  • return_value – the value returned by the function, None if it hasn’t been called yet.
action()

This class overrides this method

get_return()
Returns:The return value from the function call