Skip to content

PickOne is a small handy library designed let the user choose between a set of values

License

Notifications You must be signed in to change notification settings

riccardocagnasso/pickone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pickone

PickOne is a small handy library designed let the user choose between a set of values.

Examples

from pickone import *

PO = PickOne(['foo', 'bar', 'baz'])
PO.ask()
Choose one from [2=baz 0=foo 1=bar]: 1
'bar'

PO.ask()
Choose one from [2=baz 0=foo 1=bar]: foo
'foo'

PO = PickOne({'f': 'foo', 'b': 'bar'}, default='f')
PO.ask()
Choose one from [b=bar f=foo] (default=f): b
'bar'

PO.ask()
Choose one from [b=bar f=foo] (default=f): foo
'foo'

PO.ask()
Choose one from [b=bar f=foo] (default=f): 
'foo'

About

PickOne is a small handy library designed let the user choose between a set of values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages