Sorry to be 6 years late, but I recently came up with a good way to do this without making your code dirty and hard to maintain. This is pretty much what DaveTheScientist said, but I just want to expand it a bit. Usually, in Tkinter, if you want a button to call a function, you do the following:
exampleButton = Button(root, text = 'Example', command = someFunc)
This will just call someFunc whenever a button is pressed. If this function, however, takes arguments, you need to use lambdas and do something like this:
exampleButton = Button(root, text = 'Example', command = lambda: someFunc(arg1, arg2))
The above line of code starts someFunc and uses the variables arg1 and arg2 as arguments for this function. Now, what could you do in a program where many times you need functions launched by buttons to return values, creates a new function that is called by each button.
This function executes the function that you want your button to run as the first argument, and then the function arguments.
def buttonpress(function, *args): value = function(*args)
Then, when you create the button, you do:
exampleButton = Button(root, text = 'Example', command = lambda: buttonpress( someFunc, arg1, arg2 ))
This will run this function (in this case someFunc ) and save the return value in the value variable. This also has the advantage that you can use as many arguments as you want for the function that your button launches.