I wanted to get input from a tkinter.Text object in python
msg = tkinter.StringVar()
message = tkinter.Entry(mainframe, textvariable=msg)
but it gives an error
I also tried the get method
thetext = message.get('1.0', 'end')
but it gives this error:
return self.tk.call(self._w, 'get', index1, index2)
_tkinter.TclError: invalid command name ".!text"
When you close (destroy) window then it removes (destroys) also
Entry(and other widgets) and you get error when you try to useEntry. You have to get text fromEntrybefore you close (destroy) window.OR
Because you use
StringVarinEntryso you can get this text fromStringVareven after closing (destroying) window.Minimal working example which shows this problem and solutions.