def menu_prompt(model, prompt=' > ', rows=None, header=None, theading=None, footer=None, force=0):
 content = ''
 for x in (header, theading, rows, footer):
  if isinstance(x, list):
   for line in x:
    content += (line + '\n')
  elif isinstance(x, str):
   content += (x + '\n')
 g.content = content
 screen.update()
 choice = input(prompt)
 if (choice in model):
  return model[choice]
 elif force:
  return menu_prompt(model, prompt, rows, header, theading, footer, force)
 elif (not choice.strip()):
  return (False, False)
 else:
  return (False, 'abort')

def menu_prompt ( model , prompt = ' > ' , rows = None , header = None , theading = None , footer = None , force = 0 ) : content = '' for x in ( header , theading , rows , footer ) : if isinstance ( x , list ) : for line in x : content += ( line + '\n' ) elif isinstance ( x , str ) : content += ( x + '\n' ) g . content = content screen . update ( ) choice = input ( prompt ) if ( choice in model ) : return model [ choice ] elif force : return menu_prompt ( model , prompt , rows , header , theading , footer , force ) elif ( not choice . strip ( ) ) : return ( False , False ) else : return ( False , 'abort' )
generate a list of choice .