PyDocs

Nav

Graphical user interfaces with Tk

Text.count

tkinter

method of Text · Added in 3.3
  • Text.count(index1, index2, *options, return_ints=False)
Count the number of items of the requested kinds between index1 and index2; the count is negative if index1 is after index2. Each of options names a kind of item to count: 'chars', 'displaychars', 'displayindices', 'displaylines', 'indices', 'lines', 'xpixels' or 'ypixels' (the default, used when no option is given, is 'indices'). The pseudo-option 'update' forces any out-of-date layout information to be recalculated before the following options are evaluated. When return_ints is true and a single counting option is given, return a plain integer; otherwise return a tuple with one integer per counting option (or None if the result is empty).
Changed in 3.13
  • 3.13: Added the return_ints parameter.
0 Examples
No examples for tkinter/Text.count.
See Also
No see-alsos for tkinter/Text.count
0 Notes
No notes for Text.count