Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Python Tk Button with action

import tkinter as tk

def run_action():
    print("clicked")

app = tk.Tk()
app.title('Single Button')

action_button = tk.Button(app, text='Action', width=25, command=run_action)
action_button.pack()
#action_button.pack(side="left")

exit_button = tk.Button(app, text='Close', width=25, command=app.destroy)
exit_button.pack()

app.mainloop()