Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

askcli

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

askcli

Generate interactive menus in a python script. Like yes/no question and menu action.

  • 1.0.4
  • PyPI
  • Socket score

Maintainers
1

Create Menu like this

from askcli import Menu, Item
items = list()
# create items list
items = [Item('a', 'Action A'), Item('b', 'Action B'), 'action 3', Item('q', 'Quitter')]

m = Menu(items)
# print and wait keypress
m.launch()

print('_______')
print("you choose {0} : {1}".format(m.choose, m.get_choosen_text()))

render

  a - Action a
  b - Action b
  3 - action 3
  q - Quitter
? input : f
 X - error key, (unavailable)
? input : q
_______
toy choose menu q : Quitter

Yes/No questions

from askcli.ask_bool import AskBool
a = AskBool('valid',t_text="Yes",f_text="No",required=True)
res = a.launch(err_mess="choose [yes] or [no]")
print('_____')
print("bool: {0}. choice {1}".format(res, a.get_text()))

render


 ? Confirmer [o/N] : yes
 x choose [yes] or [no]
 ? Confirmer [o/N] : oui
_____
bool: True. choix Oui

AskCli_img
github project

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc