Dec-06-2017, 08:22 PM
This seems to work:
>>> import tkinter as tk >>> root = tk.Tk() >>> in_text = tk.Text(root, height=20, width=30) >>> in_text.pack() >>> out_text = tk.Text(root, height=20, width=30) >>> out_text.pack() >>> def on_click(): ... value = in_text.get("0.0", tk.END) ... out_text.insert("0.0", "you clicked!" + value * 2) ... >>> tk.Button(root, height=1, width=10, text="Commit", command=on_click).pack()