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
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:
On Fri, Nov 7, 2014 at 5:16 AM, Veek M vek.m1...@gmail.com 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,
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 the different
On Fri, Nov 7, 2014 at 9:16 PM, Veek M vek.m1...@gmail.com 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,
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
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