Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

tkinter button command with arguments

from functools import partial
#
#
def function_name(arg1):
    print(arg1)
#
#tkinter codes for GUI
#
buttonExample = tk.Button(main, text="Button", command=partial(function_name, argument1))
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #tkinter #button #command #arguments
ADD COMMENT
Topic
Name
2+7 =