I am a novice Python/Tkinter user and not clear for me how to pass widget content. I supposed usrtext is a global variable - but it prints an empty string. However, Text has real content. What is the way to pass correctly?
class App(object):
def __init__(self, root):
frame = Frame(root)
frame.grid()
usrtext = Text(bg = "light yellow", fg = "black",relief=SUNKEN)
usrtext.grid(row=0, columnspan=16, rowspan=2, sticky=W+E+N+S, padx=5, pady=5)
...
...
def do_it():
print usrtext // I'd like to see usrtext _here_
...
...
root = Tk()
root.title("My First Attempt")
usrtext=StringVar()
usrtext=""
...
...
butt1 = Button(root, text='Do it', height=1, width=10, relief=RAISED, command=do_it)
butt1.grid(row=4, column=14)
app = App(root)
root.mainloop()