PyDocs

Graphical user interfaces with Tk

tkinter.messagebox

The tkinter.messagebox module provides a template base class as well as a variety of convenience methods for commonly used configurations. The message boxes are modal: each blocks until the user responds, then returns a value that depends on the function. The show* functions and Message.show() return the symbolic name of the button the user pressed, as a string (such as OK or YES). Common message box styles and layouts include but are not limited to:
Symbols in tkinter.messagebox

a

ABORTRETRYIGNORE
Displays three buttons whose symbolic names are ABORT, RETRY and IGNORE.
askokcancel
Ask if operation should proceed.
askquestion
Ask a question.
askretrycancel
Ask if operation should be retried.
askyesno
Ask a question.
askyesnocancel
Ask a question.

m

Message
Create a message window with an application-specified message, an icon and a set of buttons.

o

OKCANCEL
Displays two buttons whose symbolic names are OK and CANCEL.

r

RETRYCANCEL
Displays two buttons whose symbolic names are RETRY and CANCEL.

s

showerror
Creates and displays an error message box with the specified title and message.
showinfo
Creates and displays an information message box with the specified title and message.
showwarning
Creates and displays a warning message box with the specified title and message.

y

YESNO
Displays two buttons whose symbolic names are YES and NO.
YESNOCANCEL
Displays three buttons whose symbolic names are YES, NO and CANCEL.