Suppose I have the following Button made with Tkinter in Python:
Button
import Tkinter as Tk win = Tk.Toplevel() frame = Tk.Frame(master=win).grid(row=
Use lambda
import tkinter as tk root = tk.Tk() def go(text): print(text) b = tk.Button(root, text="Click", command=lambda: go("hello")) b.pack() root.mainloop()
output:
hello