New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pydialog

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pydialog

Command line dialogs made easy.

  • v0.1
  • PyPI
  • Socket score

Maintainers
1

pydialog

Command line dialogs made easy.

Installation

From github:

git clone https://github.com/nicr9/pydialog.git
cd pydialog
sudo python2.7 setup.py install

Examples

First things first, import Dialog:

from pydialog import Dialog

This is used to make a variety of different dialogs for collecting user input.

For example, asking user for a string:

d = Dialog("What's your name?")
d.input() # This blocks until user answers

print "Hello %s" % d.result

You can also ask the user to choose from a selection:

d = Dialog("Which do you prefer?")
d.choose(['cake', 'chocolate'])

print "I like %s too!" % d.result

Or maybe you just want the answer to a yes/no question?:

d = Dialog("Do you want to quit?")
d.yesno()

if d.result:
    quit()

Finally, you can also ask users for passwords. This is like the Dialog.input() method shown above but it doesn't display what the user is typing:

d = Dialog("Please enter your password")
d.secret()

sign_in(username, d.result)

Author

Name: Nic Roland
Twitter: @nicr9_
email: nicroland9@gmail.com

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