[Tutor] The Tkinter Text widget and .get()

Liam Clarke cyresse at gmail.com
Sun Feb 6 19:58:34 CET 2005

>From http://effbot.org/books/tkinterbook/text.htm


Indexes are used to point to positions within the text handled by the
text widget. Like Python sequence indexes, text widget indexes
correspond to positions between the actual characters.

Tkinter provides a number of different index types:


      line/column ("line.column")

      line end ("line.end")




      user-defined marks

      user-defined tags ("tag.first", "tag.last")

      selection (SEL_FIRST, SEL_LAST)

      window coordinate ("@x,y")

      embedded object name (window, images)


I believe you want textWidget.get(1.0, END)
But I seriously recommend the above book.

1.0 is line 1, column 0, to END of text.


Liam Clarke

On Sun, 6 Feb 2005 16:18:13 +0200, Mark Kels <mark.kels at gmail.com> wrote:
> Hi all.
> As I understand, .get() has to get an index argument to get the text
> from the Text index...
> The problem is that I dont realy understand what is this index thing
> and what index do I need to give to the function so I'll get all the
> text in the widget.
> Any ideas ??
> Thanks !
> --
> 1. The day Microsoft makes something that doesn't suck is probably the
> day they start making vacuum cleaners.
> 2. Unix is user friendly - it's just picky about it's friends.
> 3. Documentation is like sex: when it is good, it is very, very good.
> And when it is bad, it is better than nothing. - Dick Brandon
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.

More information about the Tutor mailing list