So I'm trying to make a main menu. But my code automatically runs execfile("list.py") before making the button for it.
def list():
master.withdraw()
execfile("list.py")
listb = Button(master, text = "Patient List", command=list())
listb.grid(row=1, column=1)
How do I fix this?