[Python-ideas] intput()

Joao S. O. Bueno jsbueno at python.org.br
Wed Jan 27 07:44:57 EST 2016


for name, obj in __builtins__.__dict__.items():
   if isinstance(obj, type) and not issubclass(obj, BaseException):
       globals()[name + "put"] = lambda obj=obj, name=name:
obj(input("Please type in a {}: ".format(name)))

On 26 January 2016 at 17:13, Bar Harel <bzvi7919 at gmail.com> wrote:
> ynput can use distutils.util.strtobool instead of defining for itself (just
> an added bonus)
>
> On Tue, Jan 26, 2016 at 5:30 PM Random832 <random832 at fastmail.com> wrote:
>>
>> 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.
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list