
def intput(): return int(input()) Life would be just marginally easier, with a punny function name as a bonus.

Me: *sees intput* Huh, there's a typo here. Let me just change it back to input! *program explodes* Seriously, it's too easy to mistype to me. On January 25, 2016 9:11:56 AM CST, Marcel O'Neil <marcel@marceloneil.com> wrote:
-- Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.

def dictput(): input() raise SyntaxError("You entered a dict in the wrong way") Will probably raise a few lols. btw flintput is float(int(input()) which rounds down. flinput is float(input()). -- Bar On Mon, Jan 25, 2016 at 10:04 PM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:

Let's not forget def dolphinput(message): "get fish order from are ocean-going mammalian friends" ... flipper'nly yrs, -- ~Ethan~

Also: def linput(): 'Reads a list. Completely, 100% secure and bulletproof.' return map(eval, input[1:-1].split(','))) def ninput(): 'Reads None.' assert input() == 'None' def strinput(): 'Reads a string. Also 100% secure.' return eval("'" + input() + "'") On January 25, 2016 2:04:08 PM CST, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
-- Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.

def binput(): return bytes(map(ord, input())) This should make Python 3-haters happy: it works perfectly, without any need for thought, as long as all of your friends are American. If not, just throw in random calls to .encode and .decode all over the place until the errors go away. Sent from my iPhone

For the ducks among us. Simple, Clean, Efficient and Secure. The 4 S/C/E/S. def duckput(): """Reads anything. 'Cause there's never too much ducktyping""" return eval(input()+";") # ; makes sure there is only one line. On Mon, Jan 25, 2016 at 11:58 PM Ryan Gonzalez <rymg19@gmail.com> wrote:

Just decorate it with fuckit <https://github.com/ajalt/fuckitpy> and everything will be alright. Make sure to follow the module's guideline though: "This module is like violence: if it doesn't work, you just need more of it." On Tue, Jan 26, 2016 at 12:30 AM Andrew Barnert <abarnert@yahoo.com> 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. D[Yn]amically, Mahmoud https://github.com/mahmoud https://twitter.com/mhashemi On Mon, Jan 25, 2016 at 2:36 PM, Bar Harel <bzvi7919@gmail.com> wrote:

... ...that's actually pretty awesome. (Other than the "is True" and "is False" stuff, which is making my OCD go haywire.) On Mon, Jan 25, 2016 at 5:01 PM, Mahmoud Hashemi <mahmoud@hatnote.com> wrote:
-- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/

On Mon, Jan 25, 2016, at 18:01, Mahmoud Hashemi wrote:
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.

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@gmail.com> wrote:

One more, ported from VB code I found via Google: def nput(n, prompt): for i in range(n): tx.schedule(puts.pop()) if prompt: tx.immediate = True tx.kick() I think this has something to do with stock derivatives? If you want to use this to get rich off high-frequency trading, you may want to cythonize or numpyize it.

Me: *sees intput* Huh, there's a typo here. Let me just change it back to input! *program explodes* Seriously, it's too easy to mistype to me. On January 25, 2016 9:11:56 AM CST, Marcel O'Neil <marcel@marceloneil.com> wrote:
-- Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.

def dictput(): input() raise SyntaxError("You entered a dict in the wrong way") Will probably raise a few lols. btw flintput is float(int(input()) which rounds down. flinput is float(input()). -- Bar On Mon, Jan 25, 2016 at 10:04 PM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:

Let's not forget def dolphinput(message): "get fish order from are ocean-going mammalian friends" ... flipper'nly yrs, -- ~Ethan~

Also: def linput(): 'Reads a list. Completely, 100% secure and bulletproof.' return map(eval, input[1:-1].split(','))) def ninput(): 'Reads None.' assert input() == 'None' def strinput(): 'Reads a string. Also 100% secure.' return eval("'" + input() + "'") On January 25, 2016 2:04:08 PM CST, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
-- Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.

def binput(): return bytes(map(ord, input())) This should make Python 3-haters happy: it works perfectly, without any need for thought, as long as all of your friends are American. If not, just throw in random calls to .encode and .decode all over the place until the errors go away. Sent from my iPhone

For the ducks among us. Simple, Clean, Efficient and Secure. The 4 S/C/E/S. def duckput(): """Reads anything. 'Cause there's never too much ducktyping""" return eval(input()+";") # ; makes sure there is only one line. On Mon, Jan 25, 2016 at 11:58 PM Ryan Gonzalez <rymg19@gmail.com> wrote:

Just decorate it with fuckit <https://github.com/ajalt/fuckitpy> and everything will be alright. Make sure to follow the module's guideline though: "This module is like violence: if it doesn't work, you just need more of it." On Tue, Jan 26, 2016 at 12:30 AM Andrew Barnert <abarnert@yahoo.com> 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. D[Yn]amically, Mahmoud https://github.com/mahmoud https://twitter.com/mhashemi On Mon, Jan 25, 2016 at 2:36 PM, Bar Harel <bzvi7919@gmail.com> wrote:

... ...that's actually pretty awesome. (Other than the "is True" and "is False" stuff, which is making my OCD go haywire.) On Mon, Jan 25, 2016 at 5:01 PM, Mahmoud Hashemi <mahmoud@hatnote.com> wrote:
-- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/

On Mon, Jan 25, 2016, at 18:01, Mahmoud Hashemi wrote:
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.

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@gmail.com> wrote:

One more, ported from VB code I found via Google: def nput(n, prompt): for i in range(n): tx.schedule(puts.pop()) if prompt: tx.immediate = True tx.kick() I think this has something to do with stock derivatives? If you want to use this to get rich off high-frequency trading, you may want to cythonize or numpyize it.
participants (12)
-
Alexander Walters
-
Andrew Barnert
-
Bar Harel
-
Ethan Furman
-
Geoffrey Spear
-
Greg Ewing
-
Joao S. O. Bueno
-
Mahmoud Hashemi
-
Marcel O'Neil
-
Random832
-
Rob Cliffe
-
Ryan Gonzalez