import tkinter as tk root = tk.Tk() btn = tk.Button(root, "Press me") def do_something(): pass btn.bind('<Return>', do_something)