How do I pass parameters to a function through a button?
variable = str()
def RandomFunction(variable):
print (variable)
EntryBox = Entry(MainWindow, textvariable = variable).pack()
FunctionCall = Button(MainWindow, text="Enter", command=RandomFunction(variable))
It seems like it just doesnt print anything when the button is pressed. I've searched around and it seems that using lambda can fix it and allow (variable) to be passed to the function but after experimenting with lambda variable:variable I still can't get it to work.
lambdacorrectly.Entrywidget here?