Re: question about input() and/or raw_input()

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 1:12 PM, Gene Heskett wrote: > On Sunday 19 January 2014 15:11:52 Larry Martell did opine: > >> On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence > wrote: >> > On 19/01/2014 18:15, Grant Edwards wrote: >> >> On 2014-01-19, Mark Lawrence wrote: >> >>> Actually, to go off at

Re: question about input() and/or raw_input()

2014-01-19 Thread Gene Heskett
On Sunday 19 January 2014 15:08:31 Roy Smith did opine: > In article , > > Grant Edwards wrote: > > I can still remember the point in my first trip to the UK when I > > accidentally stumbled across darts on TV. Given the endless variety > > (and quantity) of pointless crap that people watch her

Re: question about input() and/or raw_input()

2014-01-19 Thread Gene Heskett
On Sunday 19 January 2014 15:11:52 Larry Martell did opine: > On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence wrote: > > On 19/01/2014 18:15, Grant Edwards wrote: > >> On 2014-01-19, Mark Lawrence wrote: > >>> Actually, to go off at a tangent, I'm just getting into GUIs via > >>> wxPython. I'v

Re: question about input() and/or raw_input()

2014-01-19 Thread Ethan Furman
On 01/19/2014 10:41 AM, Chris Angelico wrote: On Mon, Jan 20, 2014 at 4:50 AM, Ethan Furman wrote: The difference I was thinking of is: "%h" % 3.14 # this works vs. hex(3.14) # this raises In 3.5 both will raise. Now you have me *thoroughly* intrigued. It's not %h (incomplete form

Re: question about input() and/or raw_input()

2014-01-19 Thread Mark Lawrence
On 19/01/2014 19:24, Larry Martell wrote: On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence wrote: On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence wrote: Actually, to go off at a tangent, I'm just getting into GUIs via wxPython. I've discovered there are distinct advan

Re: question about input() and/or raw_input()

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence wrote: > On 19/01/2014 18:15, Grant Edwards wrote: >> >> On 2014-01-19, Mark Lawrence wrote: >>> Actually, to go off at a tangent, I'm just getting into GUIs via >>> wxPython. I've discovered there are distinct advantages having to >>> write endles

Re: question about input() and/or raw_input()

2014-01-19 Thread Mark Lawrence
On 19/01/2014 18:15, Grant Edwards wrote: On 2014-01-19, Mark Lawrence wrote: On 18/01/2014 18:41, Mark Lawrence wrote: On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other th

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-19, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> I can still remember the point in my first trip to the UK when I >> accidentally stumbled across darts on TV. Given the endless variety >> (and quantity) of pointless crap that people watch here in the US, I >> can't real

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 5:37 AM, Roy Smith wrote: > What's so complicated? > > points = 501 > for dart in throws(): >if points - dart == 0 and dart.is_double(): > raise YouWin >if points - dart < 0: > continue >points -= dart >beer.drink() assert victory raise beer Ch

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 4:50 AM, Ethan Furman wrote: > The difference I was thinking of is: > > "%h" % 3.14 # this works > > vs. > > hex(3.14) # this raises > > In 3.5 both will raise. Now you have me *thoroughly* intrigued. It's not %h (incomplete format - h is a modifier), nor %H (unsuppo

Re: question about input() and/or raw_input()

2014-01-19 Thread Roy Smith
In article , Grant Edwards wrote: > I can still remember the point in my first trip to the UK when I > accidentally stumbled across darts on TV. Given the endless variety > (and quantity) of pointless crap that people watch here in the US, I > can't really explain why I was so baffled and amused

Re: question about input() and/or raw_input()

2014-01-19 Thread Ethan Furman
On 01/19/2014 08:38 AM, Chris Angelico wrote: On Mon, Jan 20, 2014 at 3:14 AM, Ethan Furman wrote: --> def quux1(x): return str(x+1) --> quux1(2.3) '3.3' (Will be) fixed in 3.5 [1] :) [1] Which is to say, both will raise an exception. Why would that raise? Sorry, should have read that c

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-19, Mark Lawrence wrote: > On 18/01/2014 18:41, Mark Lawrence wrote: >> On 18/01/2014 18:30, Roy Smith wrote: >>> Pardon me for being cynical, but in the entire history of the universe, >>> has anybody ever used input()/raw_input() for anything other than a >>> homework problem? >> >> N

Re: question about input() and/or raw_input()

2014-01-19 Thread Mark Lawrence
On 18/01/2014 18:41, Mark Lawrence wrote: On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Not me personally. I guess raw_input must have been us

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 4:42 AM, Grant Edwards wrote: > 2) I didn't claim that sys.stdin.readline() was as simple as using >input. I didn't claim it was preferable. I merely presented it as >a refutation to the argument that if you don't use input/raw_input >then you have to use a GU

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-19, Dennis Lee Bieber wrote: > On Sun, 19 Jan 2014 16:14:48 + (UTC), Grant Edwards > declaimed the following: > >>On 2014-01-18, Terry Reedy wrote: >>> On 1/18/2014 1:30 PM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybo

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Mon, Jan 20, 2014 at 3:14 AM, Ethan Furman wrote: >>> --> def quux1(x): return str(x+1) >> --> quux1(2.3) >> '3.3' > > (Will be) fixed in 3.5 [1] :) > [1] Which is to say, both will raise an exception. Why would that raise? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: question about input() and/or raw_input()

2014-01-19 Thread Ethan Furman
On 01/19/2014 12:26 AM, Rustom Mody wrote: On Sunday, January 19, 2014 10:29:58 AM UTC+5:30, Chris Angelico wrote: On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote: As do these pieces of code: --> def quux1(x): return str(x+1) --> def quux2(x): return hex(x+1)[2:] They do? --> quux1(2.3

Re: question about input() and/or raw_input()

2014-01-19 Thread Grant Edwards
On 2014-01-18, Terry Reedy wrote: > On 1/18/2014 1:30 PM, Roy Smith wrote: >> Pardon me for being cynical, but in the entire history of the universe, >> has anybody ever used input()/raw_input() for anything other than a >> homework problem? > > Homework problems (and 'toy' programs, such as hangm

Re: question about input() and/or raw_input()

2014-01-19 Thread Chris Angelico
On Sun, Jan 19, 2014 at 7:26 PM, Rustom Mody wrote: > If you want to give an irrelevant example at least give a correct one :D > the difference between str and hex is an arcane difference (Ive never used > hex) > the difference between functions and procedures is absolutely basic. They don't giv

Re: question about input() and/or raw_input()

2014-01-19 Thread Rustom Mody
On Sunday, January 19, 2014 10:29:58 AM UTC+5:30, Chris Angelico wrote: > On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote: > > Because these two pieces of code > def foo(x): print x+1 > def bar(x): return x+1 > > look identical (to a beginner at least) > foo(3) > > 4 > bar(3)

Re: question about input() and/or raw_input()

2014-01-18 Thread Steven D'Aprano
On Sat, 18 Jan 2014 13:30:20 -0500, Roy Smith wrote: > Pardon me for being cynical, but in the entire history of the universe, > has anybody ever used input()/raw_input() for anything other than a > homework problem? Yes. They are excellent for interactive command line tools. -- Steven -- htt

Re: question about input() and/or raw_input()

2014-01-18 Thread Chris Angelico
On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote: > Because these two pieces of code > def foo(x): print x+1 > def bar(x): return x+1 > > look identical (to a beginner at least) > foo(3) > 4 bar(3) > 4 As do these pieces of code: >>> def quux(x): return str(x+1) >>> de

Re: question about input() and/or raw_input()

2014-01-18 Thread Rustom Mody
On Sunday, January 19, 2014 9:51:36 AM UTC+5:30, Chris Angelico wrote: > On Sun, Jan 19, 2014 at 3:15 PM, Rustom Mody wrote: > > On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote: > >> Pardon me for being cynical, but in the entire history of the universe, > >> has anybody ever use

Re: question about input() and/or raw_input()

2014-01-18 Thread Chris Angelico
On Sun, Jan 19, 2014 at 3:15 PM, Rustom Mody wrote: > On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote: >> Pardon me for being cynical, but in the entire history of the universe, >> has anybody ever used input()/raw_input() for anything other than a >> homework problem? > > Simila

Re: question about input() and/or raw_input()

2014-01-18 Thread Rustom Mody
On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote: > Pardon me for being cynical, but in the entire history of the universe, > has anybody ever used input()/raw_input() for anything other than a > homework problem? Similar 'cynicism' regarding print would be salutary for producin

Re: question about input() and/or raw_input()

2014-01-18 Thread Chris Angelico
On Sun, Jan 19, 2014 at 8:33 AM, Terry Reedy wrote: > On 1/18/2014 1:30 PM, Roy Smith wrote: >> >> Pardon me for being cynical, but in the entire history of the universe, >> has anybody ever used input()/raw_input() for anything other than a >> homework problem? > > > Homework problems (and 'toy'

Re: question about input() and/or raw_input()

2014-01-18 Thread Terry Reedy
On 1/18/2014 1:30 PM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Homework problems (and 'toy' programs, such as hangman), whether in a programming class or elsewh

Re: question about input() and/or raw_input()

2014-01-18 Thread Peter Otten
Roy Smith wrote: > Pardon me for being cynical, but in the entire history of the universe, > has anybody ever used input()/raw_input() for anything other than a > homework problem? I use it for pointless throwaway tools, sometimes via the cmd module, sometimes directly. I like that you can add

Re: question about input() and/or raw_input()

2014-01-18 Thread Emile van Sebille
On 01/18/2014 10:30 AM, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Yes - routinely. Emile -- https://mail.python.org/mailman/listinfo/python-list

Re: question about input() and/or raw_input()

2014-01-18 Thread Mark Lawrence
On 18/01/2014 18:30, Roy Smith wrote: Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? Not me personally. I guess raw_input must have been used somewhere at some time for something, o

question about input() and/or raw_input()

2014-01-18 Thread Roy Smith
Pardon me for being cynical, but in the entire history of the universe, has anybody ever used input()/raw_input() for anything other than a homework problem? -- https://mail.python.org/mailman/listinfo/python-list