Ned Batchelder wrote:
> On 11/7/14 9:52 AM, Veek M wrote:
> and you want to end up on the "def" token, not the "def" in
yep, bumped into this :) thanks!
--
https://mail.python.org/mailman/listinfo/python-list
On 11/7/14 9:52 AM, Veek M wrote:
Veek M wrote:
new_col = self.b[row].index('def')
self.w.cursor = row, new_col
new_col = self.b[row].rindex('def')
self.w.cursor = row, new_col
There's also the different methods index vs
On Fri, 07 Nov 2014 16:46:19 +0630, Veek M wrote:
(1) Pass a true or false parameter to the function as the direction of
search toggle.
(2) replace the relevant assignments with something like:
variable = something if condition else something else
(3) Figuring out the while loop control is a
Veek M wrote:
> new_col = self.b[row].index('def')
> self.w.cursor = row, new_col
> new_col = self.b[row].rindex('def')
> self.w.cursor = row, new_col
There's also the different methods index vs rindex. Does this sort of thing
jus
On Fri, Nov 7, 2014 at 9:16 PM, Veek M wrote:
> def jump_to_blockD(self):
> end = len(self.b)
> row, col = self.w.cursor
> while row <= end:
> try:
> new_col = self.b[row].index('def')
> self.w.cursor = row, new_col
>
On Fri, 07 Nov 2014 21:22:22 +0630, Veek M wrote:
> Veek M wrote:
>
>
>> new_col = self.b[row].index('def') self.w.cursor = row,
>> new_col
>
>> new_col = self.b[row].rindex('def')
>> self.w.cursor = row, new_col
>
> There's also
On Fri, Nov 7, 2014 at 5:16 AM, Veek M wrote:
> def jump_to_blockD(self):
> end = len(self.b)
> row, col = self.w.cursor
> while row <= end:
> try:
> new_col = self.b[row].index('def')
> self.w.cursor = row, new_col
>
def jump_to_blockD(self):
end = len(self.b)
row, col = self.w.cursor
while row <= end:
try:
new_col = self.b[row].index('def')
self.w.cursor = row, new_col
break
except ValueError:
pa
duncan smith writes:
> [...] It was the "top / bottom of the [TV] programme" that I didn't
> immediately get, because I was thinking of a timeline running left
> to right (perhaps rather than the script used by the presenters).
is it just me that thinks of a timeline running from the wall behind
d bite your
>> behind when you least expect it.
>
> More generally, I'd say that this is solving a (very) slightly different
> problem: it's providing a "toggle with default" feature,
> where the part after the else is the default. If you don't want a
> defau
his is solving a (very) slightly
different problem: it's providing a "toggle with default" feature,
where the part after the else is the default. If you don't want a
default, that's a bug. I've known times when that default makes life a
lot easier, in which case it'd be a feature.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 11/10/14 20:55, William Ray Wing wrote:
> On Oct 11, 2014, at 3:20 PM, Dennis Lee Bieber wrote:
>
>> On Sat, 11 Oct 2014 16:26:43 +0100, duncan smith
>> declaimed the following:
>>
>>
>>> The media have their own quirks when it comes to English. The BBC
>>> regularly use "top of" / "bottom of
On Oct 11, 2014, at 3:20 PM, Dennis Lee Bieber wrote:
> On Sat, 11 Oct 2014 16:26:43 +0100, duncan smith
> declaimed the following:
>
>
>> The media have their own quirks when it comes to English. The BBC
>> regularly use "top of" / "bottom of" in the sense of "start of" / "end
>> of", but I d
On 11 October 2014 10:37:51 BST, Christian Gollwitzer wrote:
>I tend to agree that British English is the "correct" version for me,
>since I'm European, though not British.
>
>The usage of -ise in verbs, however, is a newer attempt to set the
>British English apart from the American:
>
>
On 11/10/14 12:45, mm0fmf wrote:
> On 11/10/2014 10:37, Christian Gollwitzer wrote:
>> Being a non-native English speaker/writer, I myself stick to the
>> recommendations of the Oxford dictionary.
>>
>> Christian
>
> But you do realise the Oxford dictionary is different to English usage
> and
On 11/10/2014 10:37, Christian Gollwitzer wrote:
Being a non-native English speaker/writer, I myself stick to the
recommendations of the Oxford dictionary.
Christian
But you do realise the Oxford dictionary is different to English usage
and is renowned for using what is known as Oxford s
On Sat, Oct 11, 2014 at 9:33 PM, Marko Rauhamaa wrote:
> I'm getting a new appreciation for Lisp's age-old "car" and "cdr".
>
> The scientists have done this international thing for centuries. Their
> single-letter naming might be the secret of their glorious success.
>
> Obscure acronyms for the
Dennis Lee Bieber :
> And then there is REXX... Which deliberately has both centre() and
> center() in its standard library -- and they do the same thing...
I'm getting a new appreciation for Lisp's age-old "car" and "cdr".
The scientists have done this international thing for centuries. Their
s
Am 10.10.14 22:05, schrieb alister:
Would the French tolerate me using an alternative Variant (Canadian or
Carribean)? I think not
UK English as spoken in England is the definitive version. The clue is in
the Name - English not American
I tend to agree that British English is the "correct" ver
On Fri, 10 Oct 2014 22:01:58 +0300, Marko Rauhamaa wrote:
> alister :
>
>> On Thu, 09 Oct 2014 23:48:36 +0300, Marko Rauhamaa wrote:
>>
>>> "-ize" is standard everywhere in the English-speaking world.
>>
>> Not in England!
>
> http://www.oxforddictionaries.com/definition/english/realize>
>
> Bo
alister :
> On Thu, 09 Oct 2014 23:48:36 +0300, Marko Rauhamaa wrote:
>
>> "-ize" is standard everywhere in the English-speaking world.
>
> Not in England!
http://www.oxforddictionaries.com/definition/english/realize>
Both -ize and -ise are valid in England.
>> why wouldn't you use American Eng
On 10/10/2014 15:46, Neil D. Cerutti wrote:
On 10/9/2014 3:53 PM, Tim Delaney wrote:
That would be a theatre programme vs a computer program.
I try to stick with the current spelling style when modifying existing
code - esp. for APIs. It's very annoying to have some methods use "z"
and others "
On 09/10/2014 23:53, Terry Reedy wrote:
Like it or not, Python uses American English.
It is my understanding that this has been agreed to by a Dutch born
dictator. The traitor should be shot, selling out his fellow Europeans
to the North Americans indeed :)
--
My fellow Pythonistas, ask
On Thu, 09 Oct 2014 23:48:36 +0300, Marko Rauhamaa wrote:
> Tim Delaney :
>
>> It's very annoying to have some methods use "z" and others "s" in the
>> same package.
>
> "-ize" is standard everywhere in the English-speaking world.
Not in England!
>
> Americans insist on "analyze," "paralyze" a
On 10/9/2014 3:53 PM, Tim Delaney wrote:
That would be a theatre programme vs a computer program.
I try to stick with the current spelling style when modifying existing
code - esp. for APIs. It's very annoying to have some methods use "z"
and others "s" in the same package. So since I'm currentl
On Sat, Oct 11, 2014 at 1:28 AM, Rustom Mody wrote:
>> If you dont find all this confusing, I am reminded of Schrödinger (or
>> one of his ilk):
>
>> If you dont find Quantum physics confusing you've not begun to understand it
>
> Ok: Not Schrödinger but John Wheeler:
> http://www.colorado.edu/phy
On Friday, October 10, 2014 7:54:33 PM UTC+5:30, Rustom Mody wrote:
> More telling comments from Alex (same SO post)
> 1. Both have mostly useless default implementations
> 2. if you override __repr__, that's ALSO used for __str__, but not vice versa
> 3. despite the words on the subject found in t
On Friday, October 10, 2014 12:48:20 PM UTC+5:30, Steven D'Aprano wrote:
> Rustom Mody wrote:
> > On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
> >> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
> >> Color.Red
> >> print (Color.Red)
> >> > Color.Red
>
Op 09-10-14 om 03:42 schreef Ben Finney:
> Seymore4Head writes:
>
>> I want to toggle between color="Red" and color="Blue"
> It's good to cultivate ongoing familiarity with the standard library
> https://docs.python.org/3/library/itertools.html#ite
On Fri, Oct 10, 2014 at 9:51 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> If Python ever grows a 'color' statement or keyword, then sure.
>> Otherwise, it's just identifiers and data, which are international.
>
> Do you mean that the Python syntax should use American spellings, but
> the Pyth
Chris Angelico :
> If Python ever grows a 'color' statement or keyword, then sure.
> Otherwise, it's just identifiers and data, which are international.
Do you mean that the Python syntax should use American spellings, but
the Python standard library could use words like "colour", "Farbe",
"väri"
On Fri, Oct 10, 2014 at 9:08 PM, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> Python is an international product, not American.
>
> And American English is the international software engineering language,
> minority or not.
>
> The rest of us are using it; why should you not follow suit?
If Pyt
Steven D'Aprano :
> Python is an international product, not American.
And American English is the international software engineering language,
minority or not.
The rest of us are using it; why should you not follow suit?
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Rustom Mody wrote:
> On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
>> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
>
>> Color.Red
>> print (Color.Red)
>> > Color.Red
>> > # Not sure what to make of that distinction...
>
>> That's because the intera
Rustom Mody wrote:
> In fact this:
>> >>> Color.blue.toggle()
>>
>> >>> Color.blue.toggle().toggle()
>>
>
> is a nice example of a pattern that is rarely seen:
> OO syntax, functional (ie non-state-changing) semantics.
You don't wri
Terry Reedy wrote:
> On 10/9/2014 1:43 PM, mm0fmf wrote:
>> On 09/10/2014 02:29, Steven D'Aprano wrote:
>>> Apart from the horrible spelling of colour :-)
>>
>> I've always spelt colour as "color" when programming and as "colour"
>> when writing language including documentation about software.
>
On Fri, Oct 10, 2014 at 5:52 PM, Steven D'Aprano
wrote:
> "Normal" programmers spell words the same in code as they do outside of
> code, e.g.:
>
> age
> address
> length
There's a difference between identifiers and commands, though. I would
expect, for instance, that a customer's add
mm0fmf wrote:
> On 09/10/2014 02:29, Steven D'Aprano wrote:
>> Apart from the horrible spelling of colour :-)
>
> I've always spelt colour as "color" when programming and as "colour"
> when writing language including documentation about software.
>
> colour in a programme doesn't seem right.
"N
On Fri, Oct 10, 2014 at 9:53 AM, Terry Reedy wrote:
>
>> colour in a programme doesn't seem right.
>
> Perhaps ironically, there are 52 uses of 'colour' in the stdlib, all but 4
> in idlelib, and most of those in one file. I just changed all except in the
> one file.
I agree, although I wouldn't
On 10/9/2014 1:43 PM, mm0fmf wrote:
On 09/10/2014 02:29, Steven D'Aprano wrote:
Apart from the horrible spelling of colour :-)
I've always spelt colour as "color" when programming and as "colour"
when writing language including documentation about software.
Like it or not, Python uses Americ
On 10/9/2014 8:42 AM, Rustom Mody wrote:
On Thursday, October 9, 2014 1:21:49 PM UTC+5:30, Peter Otten wrote:
Rustom Mody wrote:
BTW is there some flag that can make them identical?
No flag, but you can tweak that P:
import sys
sys.displayhook = print
"foo"
foo
def f(): pass
...
f()
Tim Delaney :
> It's very annoying to have some methods use "z" and others "s" in the
> same package.
"-ize" is standard everywhere in the English-speaking world.
Americans insist on "analyze," "paralyze" and "catalyze" but
paradoxically also on "lyse".
> So since I'm currently working for a US
On 10 October 2014 05:24, duncan smith wrote:
> On 09/10/14 18:43, mm0fmf wrote:
> > On 09/10/2014 02:29, Steven D'Aprano wrote:
> >> Apart from the horrible spelling of colour :-)
> >
> > I've always spelt colour as "color" when programming and as "colour"
> > when writing language including doc
On 09/10/14 18:43, mm0fmf wrote:
> On 09/10/2014 02:29, Steven D'Aprano wrote:
>> Apart from the horrible spelling of colour :-)
>
> I've always spelt colour as "color" when programming and as "colour"
> when writing language including documentation about software.
>
> colour in a programme doesn
On 09/10/2014 02:29, Steven D'Aprano wrote:
Apart from the horrible spelling of colour :-)
I've always spelt colour as "color" when programming and as "colour"
when writing language including documentation about software.
colour in a programme doesn't seem right.
--
https://mail.python.org/
On Thursday, October 9, 2014 9:39:07 PM UTC+5:30, Ian wrote:
> On Wed, Oct 8, 2014 at 8:34 PM, Rustom Mody wrote:
> > On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote:
> >> Seymore4Head writes:
> >> > I want to toggle between color="Red&
On Wed, Oct 8, 2014 at 8:34 PM, Rustom Mody wrote:
> On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote:
>> Seymore4Head writes:
>
>> > I want to toggle between color="Red" and color="Blue"
>
>> It's good to cultivate ongoing
On Thu, 09 Oct 2014 17:57:03 +1300, Gregory Ewing wrote:
> Seymore4Head wrote:
>> I want to toggle between color="Red" and color="Blue"
>
> toggle = {"Red": "Blue", "Blue": "Red"}
> color = toggle[color]
How about a
On Thursday, October 9, 2014 1:21:49 PM UTC+5:30, Peter Otten wrote:
> Rustom Mody wrote:
> > BTW is there some flag that can make them identical?
> No flag, but you can tweak that P:
> >>> import sys
> >>> sys.displayhook = print
> >>> "foo"
> foo
> >>> def f(): pass
> ...
> >>> f()
> None
Yea
Rustom Mody wrote:
> On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
>> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
>
>> Color.Red
>> print (Color.Red)
>> > Color.Red
>> > # Not sure what to make of that distinction...
>
>> That's because the intera
On Thu, Oct 9, 2014 at 4:39 PM, Rustom Mody wrote:
> On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
>> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
>
>> Color.Red
>> print (Color.Red)
>> > Color.Red
>> > # Not sure what to make of that distinction...
On Thursday, October 9, 2014 10:26:41 AM UTC+5:30, Steven D'Aprano wrote:
> On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
> Color.Red
> print (Color.Red)
> > Color.Red
> > # Not sure what to make of that distinction...
> That's because the interactive interpreter displays the r
On Oct 8, 2014, at 9:57 PM, Gregory Ewing wrote:
> Seymore4Head wrote:
>> I want to toggle between color="Red" and color="Blue"
Don’t forget polymorphic dispatch…
class Red(object):
def toggle(self):
return Blue()
class Blue(object):
def tog
Seymore4Head wrote:
I want to toggle between color="Red" and color="Blue"
toggle = {"Red": "Blue", "Blue": "Red"}
color = toggle[color]
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 08 Oct 2014 19:34:30 -0700, Rustom Mody wrote:
Color.Red
>
print (Color.Red)
> Color.Red
>
> # Not sure what to make of that distinction...
That's because the interactive interpreter displays the repr() of objects
(except for None, which it suppresses), while print outputs th
On Thu, Oct 9, 2014 at 2:54 PM, wrote:
> On Wed, Oct 8, 2014, at 23:02, Mark Lawrence wrote:
>> When I first read this I was extremely jealous of the originator but
>> having used it umpteen times I'm still extremely jealous of the
>> originator!!! Why doesn't my mind work like his? :)
>
> You c
On Wed, Oct 8, 2014, at 23:02, Mark Lawrence wrote:
> When I first read this I was extremely jealous of the originator but
> having used it umpteen times I'm still extremely jealous of the
> originator!!! Why doesn't my mind work like his? :)
You could also keep the ints in two variables and do
On 09/10/2014 02:25, Mark Lawrence wrote:
On 09/10/2014 01:11, Seymore4Head wrote:
I want to toggle between color="Red" and color="Blue"
Here is one:
if color == "Red":
color = "Blue"
else:
color = "Red"
Here is two
On Thursday, October 9, 2014 7:12:41 AM UTC+5:30, Ben Finney wrote:
> Seymore4Head writes:
> > I want to toggle between color="Red" and color="Blue"
> It's good to cultivate ongoing familiarity with the standard library
And language. In recent python3:
Seymore4Head writes:
> I want to toggle between color="Red" and color="Blue"
It's good to cultivate ongoing familiarity with the standard library
https://docs.python.org/3/library/itertools.html#itertools.cycle>
so that you can make use of wheels already invent
Seymore4Head wrote:
> I want to toggle between color="Red" and color="Blue"
> Here is one:
> if color == "Red":
> color = "Blue"
> else:
> color = "Red"
Apart from the horrible spelling of colour :-) th
On 09/10/2014 01:11, Seymore4Head wrote:
I want to toggle between color="Red" and color="Blue"
Here is one:
if color == "Red":
color = "Blue"
else:
color = "Red"
Here is two:
if x = "True" col
I want to toggle between color="Red" and color="Blue"
Here is one:
if color == "Red":
color = "Blue"
else:
color = "Red"
Here is two:
if x = "True" color = "Red"
else:
color="Blue"
x= not x
Others?
--
https://mail.python.org/mailman/listinfo/python-list
es the limits of the region of interest.
example:
s.pack(side=Tkinter.R^IGHT, fill=Tkinter.Y)
the carrot marks the current position. If I was to say this point, "toggle
word", I would first look to the left and the right and look forward the
character string stopped looking like a sym
En Thu, 21 Aug 2008 05:07:45 -0300, <[EMAIL PROTECTED]> escribi�:
I've a checkbutton in my GUI application which I want to work as:
1. it should be un-ticked by default,
2. should display a label in Gui, by default,
3. when user ticks the check button this should the above label goes
off the sc
Hi,
I've a checkbutton in my GUI application which I want to work as:
1. it should be un-ticked by default,
2. should display a label in Gui, by default,
3. when user ticks the check button this should the above label goes
off the screen and not longer is
displayed.
Please suggest how could I
1) Press Enable IP, the Label IP should be shown.
> 2) Toggle Enable IP (So that its unset). the Label IP should not be
> shown.
>
> #!/usr/bin/python
> from Tkinter import *
> root = Tk()
> root.title('something')
> x = StringVar()
> def display():
> if x.
* Wojciech Mu?a <[EMAIL PROTECTED]> [2007-07-04 20:13:06]:
> O.R.Senthil Kumaran wrote:
> > Any suggestions on how can i make this checkbutton effect.
> > 1) Press Enable IP, the Label IP should be shown.
> > 2) Toggle Enable IP (So that its unset). the L
O.R.Senthil Kumaran wrote:
> Any suggestions on how can i make this checkbutton effect.
> 1) Press Enable IP, the Label IP should be shown.
> 2) Toggle Enable IP (So that its unset). the Label IP should not be shown.
>
> #!/usr/bin/python
> from Tkinter import *
> roo
enabled (shown), its not very-straightforward to
hide it from the window.
Any suggestions on how can i make this checkbutton effect.
1) Press Enable IP, the Label IP should be shown.
2) Toggle Enable IP (So that its unset). the Label IP should not be shown.
#!/usr/bin/python
from Tkinter import
umn_with_attributes(1,"Install",renderer2,
text=1)
self.list.append(self.options)
tree.set_model(self.list)
def selection( self, cell, path, model ):
model[path][0] = not model[path][0]
return
It shows up but the toggle butto
71 matches
Mail list logo