I now know that to make a widget with tkinter with a command parameter with an argument I use lambda to do it. (eg Button(root, text="button", command=lambda: function(argument))
)
But what if I want to pass in multiple arguments, or in my case right now two arguments? When I just put it as lambda: function(argument1, argument2)
, it gives me an error saying:
TypeError: <lambda>() takes no arguments (1 given)
How should I do this?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.