I have this code:
#!/usr/bin/python3
from Tkinter import *
def keypress(key):
print key, "pressed"
if __name__ == '__main__':
root = Tk()
root.bind('<Return>', keypress(key="enter"))
root.bind('a', keypress(key="a"))
root.mainloop()
I realize the function is being called as soon as the program starts; how can I make it pass the arguments to the keypress function without invoking it immediately?