I'm trying to have it so that when a tkinter button is pressed, a value is assigned, and then the gui is exited. 
My problem is that root.quit has no effect from functions other than the one that called it, even nested functions.
Code:

from tkinter import Tk,Button
def buttonDialogWindow():
    root = Tk()
    def buttonPress(isHeadArg):
        #Do something
        root.quit
    Button(root, text='Front of String', command = buttonPress(1)).pack()
    Button(root, text='Back of String', command = buttonPress(0)).pack()
    root.protocol("WM_DELETE_WINDOW", root.quit)
    root.mainloop()
buttonDialogWindow()

Running the code makes the buttons appear. Clicking them has no effect on the GUI, and the mainloop does not exit.
Answer: 
The problem was that when I set the value of command, I was calling the function rather than declaring it. Using parentheses made the function get called -- if you have no parameters, the normal way to write this would be to write 
 command = buttonPress 
If you do have parameters, I found a workaround using lambda: my code currently has
 command = lambda: buttonPress(1) 
for the commands.
How to have a tkinter button destroy/quit the root window in a nested function?