O'Reilly logo

Tkinter GUI Programming by Example by David Love

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Horizontal movement

If we want to specify an index which is a certain number of characters forward from an existing index, we can append +nc, where n will be the amount of characters. Likewise, -nc will move backward n characters.

Suppose we want the range of the word Python, which we know begins at index 1.4. We could cast this to a float, add 0.6 to it (since we know it is six characters long), and then cast back to a string. However, this becomes tedious and is unnecessary. Instead, we can refer to the ending index of this word with 1.4+6c.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required