Click to See Complete Forum and Search --> : Tkinter get() method


salil
07-31-2003, 12:04 AM
I am trying to use the text widget in Tkinter in Python. I am getting very strange error when I try to read in the contents of the textbox.

While using the get method, when I call

text.get() // I get an error saying get() requires at least two
// arguments, one given.

then I call,

text.get(0) // I get an error saying get takes on one argument,
// multiple arguments given.

If any of you have used this widget successfully, then please let me know which is the correct way to use get() with text widget.


Thanks a lot!!

Stuka
07-31-2003, 10:04 AM
I opened up IDLE and played with this - what you PROBABLY want (to get all the text in the widget) is text.get(0.0, END) The arguments are in row.column format, and END is a special tag meaning the end of the widget.

salil
07-31-2003, 10:27 PM
Thanks a lot Stuka. Your solution works.

I really appreaciate your help.