Skip to main content

A boringly simple CLI input function.

Project description

GET A BINARY RESPONSE TO A QUESTION

A very boring input reading package/library. Takes a question string as an argument and returns true if y or yes is entered, false if n or no is entered, quits if q or quit is entered, and asks again if anything else is entered.

Entered characters are case insensitive, but you must enter the correct spelling or the first character of the word.

I find this useful for getting user input in a script and got tired of re-writing it in every program so decided to create a package for it.

INSTALLATION

pip install yorn

CLI USAGE

usage: yorn [-h] question

Answer yes or no to a question.

positional arguments:
  question    A question to ask.

optional arguments:
  -h, --help  show this help message and exit

img

PYTHON USAGE

from yorn import ask

question = "Would you like run my amazing program? "

if ask(question):
	run_my_amazing_function()
else
	print("Cookie monster is sad :-(")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yorn-0.0.6.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

yorn-0.0.6-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file yorn-0.0.6.tar.gz.

File metadata

  • Download URL: yorn-0.0.6.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yorn-0.0.6.tar.gz
Algorithm Hash digest
SHA256 966c8978d0def4d2e881086f4f54a5f2c601cbc0438c3874967e2daf4829f4d3
MD5 a1b816fd50e028db0753206b45ab91fb
BLAKE2b-256 9a2102824a5beb10b88cc7bf9a790b69ece00abba2c35031d3937629982b82d6

See more details on using hashes here.

File details

Details for the file yorn-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for yorn-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 53e40213a2e3db90b6716f87f5123581e928396a24ce8139d459f098e410fa8d
MD5 72dd2774e9709afc193cc39872172b6e
BLAKE2b-256 d4ff0450387efc78832c67f3ee655e1495995ec1b2d2918a2b166a4958710d8a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page