button1 = tkinter.Button(frame, text="Say hi", command=print)
button2 = tkinter.Button(frame, text="foo", command=print)
button3 = tkinter.Button(frame, text="bar", command=print)
You've probably spotted the hole in my program: print
can't specify arguments. This renders the whole thing useless and faulty. Obviously, having something like
command=print("foo")
will call that function when the object is actually instantiated and make command
the return value (if any) of that function call. (Not what I want)
So, how can I specify arguments in the above mentioned scenario, and avoid having to define seperate command
functions for each of the buttons?