Answer the question
In order to leave comments, you need to log in
How to pass parameter to button function?
There is an execute function in the module that I connect to the current script. There are fields on the form, for example, year and month, how to transfer data from these fields when clicking on the button?
I do this and it doesn't work:
from tkinter import *
from modul1 import *
root = Tk()
year = Entry()
mont = Entry()
button1 = Button(root, text = 'Выполнить', command = modul1.execute(year.get(), mont.get()))
Answer the question
In order to leave comments, you need to log in
Button(root, text = 'Выполнить', command = lambda: modul1.execute(year.get(), mont.get()))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question