- Tkinter GUI Application Development Blueprints(Second Edition)
- Bhaskar Chaudhary
- 272字
- 2021-06-24 18:35:09
Index
Indexing helps you target a particular place within a piece of text. For example, if you want to mark a particular word in bold, red, or in a different font size, you can do so if you know the index of the starting point and the index of the endpoint that needs to be targeted.
The index must be specified in one of the following formats:

Note a small quirk here. The counting of rows in a Text widget starts at 1, while the counting of columns starts at 0. Therefore, the index for the starting position of the Text widget is 1.0 (that is, row number 1 and column number 0).
An index can be further manipulated by using modifiers and submodifiers. Some examples of modifiers and submodifiers are as follows:
- end - 1 chars or end - 1 c: This refers to the index of the character before the one at the end
- insert +5lines: This refers to the index five lines ahead of the insertion cursor
- insertwordstart - 1 c: This refers to the character just before the first one in a word containing the insertion cursor
- end linestart: This refers to the index of the line start of the end line
Indexes are often used as arguments to functions. Refer to the following list for some examples:
- my_text.delete(1.0,END) : This means that you can delete from line 1 , column 0 until the end
- my_text.get(1.0, END) : This gets the content from 1.0 (beginning) to the end
- my_text.delete('insert-1c', INSERT) : This deletes a character at the insertion cursor
- Redis入門指南(第3版)
- Mastering RabbitMQ
- PHP 7底層設(shè)計與源碼實現(xiàn)
- Responsive Web Design with HTML5 and CSS3
- 趣學Python算法100例
- Bootstrap Essentials
- 深度強化學習算法與實踐:基于PyTorch的實現(xiàn)
- Learn React with TypeScript 3
- .NET 3.5編程
- Android程序設(shè)計基礎(chǔ)
- 計算機應(yīng)用基礎(chǔ)實踐教程
- Learning OpenStack Networking(Neutron)(Second Edition)
- 利用Python進行數(shù)據(jù)分析
- Maker基地嘉年華:玩轉(zhuǎn)樂動魔盒學Scratch
- 精通Spring:Java Web開發(fā)與Spring Boot高級功能