May-09-2019, 04:31 PM
u need define the function first
like this.
like this.
import tkinter as tk class Print: def __init__(self): Value = entry.get() print(Value) root = tk.Tk() label = tk.Label(root, text="Entry Box") label.pack() entry = tk.Entry(root) entry.pack() button = tk.Button(root, text="Print", command=Print) button.pack() root.mainloop()