[Python-ideas] intput()

Random832 random832 at fastmail.com
Tue Jan 26 10:30:37 EST 2016


On Mon, Jan 25, 2016, at 18:01, Mahmoud Hashemi wrote:
> I tried to have fun, but my joke ended up long and maybe useful.
> 
> Anyways, here's *ynput()*:
> 
> https://gist.github.com/mahmoud/f23785445aff7a367f78
> 
> Get yourself a True/False from a y/n.

If I were writing such a function I'd use
locale.nl_langinfo(locale.YESEXPR). (and NOEXPR) A survey of these on my
system indicates these all accept y/n, but additionally accept their own
language's term (or a related language - en_DK supports danish J/N, and
en_CA supports french O/N). Mostly these use syntax compatible with
python regex, though a few use (grouping|alternation) with no backslash.


More information about the Python-ideas mailing list