Re: [Tutor] Need to be able to accept Page Down or CTRL-E

2013-01-31 Thread Dave Angel
On 01/31/2013 10:19 PM, Dave Wilder wrote: On 01/31/2013 09:43 PM, Dave Wilder wrote: Hello, In a script I am writing, I would like to be able to accept the PAGE DOWN key as an input as well as the arrow keys. Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so, coul

Re: [Tutor] operator order

2013-01-31 Thread eryksun
On Thu, Jan 31, 2013 at 5:53 PM, Hugo Arts wrote: > a = ([], []) a[0] += [1] > TypeError: 'tuple' object does not support item assignment a > ([1], []) Yep, storing the result fails for a read-only subscript or attribute (e.g. a property without fset), but only after the in-place o

Re: [Tutor] Need to be able to accept Page Down or CTRL-E

2013-01-31 Thread Dave Wilder
>> On 01/31/2013 09:43 PM, Dave Wilder wrote: >> Hello, >> >> In a script I am writing, I would like to be able to accept the PAGE DOWN >> key as an input as well as the arrow keys. >> >> Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so, >> could someone point me to do

Re: [Tutor] Need to be able to accept Page Down or CTRL-E

2013-01-31 Thread Dave Angel
On 01/31/2013 09:43 PM, Dave Wilder wrote: Hello, In a script I am writing, I would like to be able to accept the PAGE DOWN key as an input as well as the arrow keys. Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so, could someone point me to documentation on how to

[Tutor] Need to be able to accept Page Down or CTRL-E

2013-01-31 Thread Dave Wilder
Hello, In a script I am writing, I would like to be able to accept the PAGE DOWN key as an input as well as the arrow keys. Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so, could someone point me to documentation on how to do that? I have done things like this before

Re: [Tutor] operator order

2013-01-31 Thread Alan Gauld
On 31/01/13 18:36, heathen wrote: why is this: >>> d = 2 >>> d *= 3 + 4 >>> d 14 not this: >>> d 10 Others have answered but I'll add my two cents variation... d *= 3+4 works like d *= X -> d = d * X so what is X? Is it the 3 or the 3+4. Let's put some parentheses around things to m

Re: [Tutor] operator order

2013-01-31 Thread Hugo Arts
On Thu, Jan 31, 2013 at 8:20 PM, Danny Yoo wrote: > On Thu, Jan 31, 2013 at 11:36 AM, heathen > wrote: > > why is this: > > > d *= 3 + 4 > > > The gory details about how Python understands this expression can be found > in: > > > http://docs.python.org/3/reference/simple_stmts.html#augmente

Re: [Tutor] operator order

2013-01-31 Thread Aurélien DESBRIÈRES
heathen writes: > why is this: > d = 2 d *= 3 + 4 d > 14 hmm ... because d * the result of 3 + 4 > not this: > d = 2 d = d * 3 + 4 d > 10 and here it d multiply by 3 + 4 > ___ > Tutor maillist - Tutor@python.org >

Re: [Tutor] operator order

2013-01-31 Thread Danny Yoo
On Thu, Jan 31, 2013 at 11:36 AM, heathen wrote: > why is this: > d *= 3 + 4 The gory details about how Python understands this expression can be found in: http://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements Technically, "3 + 4" is the "expression lis

Re: [Tutor] operator order

2013-01-31 Thread Nick W
because python process the expression on the right side of the assignment first. ie d *= 3+4 basically is the equivalent of writing (2) * (3+4). Hope that explains it. Nick On Thu, Jan 31, 2013 at 10:36 AM, heathen wrote: > why is this: > > >>> d = 2 > >>> d *= 3 + 4 > >>> d > 14 > > not this:

[Tutor] operator order

2013-01-31 Thread heathen
why is this: >>> d = 2 >>> d *= 3 + 4 >>> d 14 not this: >>> d = 2 >>> d = d * 3 + 4 >>> d 10 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor