1
I wonder if there’s a way to save the textual content of an object tkinter.Text
in a string variable.
Why? Because I believe the Tkinter.Text object is inside a function, and therefore it is not visible to another function that manipulates the text of the Tkinter object.Text.
I know with the method get
I can retrieve the text of the object in the scope of the latter.
def manipulateText():
# Gostaria de manipular o texto do objecto `textArea`,
# mas textArea não é visível aqui.
# Se textArea fosse do tipo `Entry`
# eu poderia salvar o texto numa variável do tipo tkinter.StringVar()
# mas tkinter.Text não fornece esta possibilidade.
def func():
win = tkinter.Tk()
textArea = tkinter.Text(win)
textArea.pack()
win.mainloop()
I didn’t understand your question. Could you exemplify with a code? In other words, if you already know how to get the widget text, what is your question?
– mgibsonbr