{ "info": { "author": "THIVOLLE-CAZAT cedric", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "License :: OSI Approved :: BSD License" ], "description": "
from askcli import Menu, Item\nitems = list()\n# create items list\nitems = [Item('a', 'Action A'), Item('b', 'Action B'), 'action 3', Item('q', 'Quitter')]\n\nm = Menu(items)\n# print and wait keypress\nm.launch()\n\nprint('_______')\nprint(\"you choose {0} : {1}\".format(m.choose, m.get_choosen_text()))\n\n\nrender\n\n a - Action a\n b - Action b\n 3 - action 3\n q - Quitter\n? input : f\n X - error key, (unavailable)\n? input : q\n_______\ntoy choose menu q : Quitter\n\n\nfrom askcli.ask_bool import AskBool\na = AskBool('valid',t_text=\"Yes\",f_text=\"No\",required=True)\nres = a.launch(err_mess=\"choose [yes] or [no]\")\nprint('_____')\nprint(\"bool: {0}. choice {1}\".format(res, a.get_text()))\n\n\nrender\n\n\n ? Confirmer [o/N] : yes\n x choose [yes] or [no]\n ? Confirmer [o/N] : oui\n_____\nbool: True. choix Oui\n\n\n\n\t
\n\tgithub project\n