carriage return / Tkinter

Doug Hellmann doughellmann at home.com
Wed Sep 8 21:14:31 EDT 1999


Greg Wilson wrote:
> 
> Hi.  I've created an Entry widget using Tkinter, and would like a command
> run when the user presses carriage return --- how do I do this?
> Thanks,
> Greg

Bind your callback to the event '<Return>':

entry.bind('<Return>', my_handler)

def my_handler(event):
  print 'Got a "<Return>" event.'

Doug




More information about the Python-list mailing list