I want to show alerts in tkinter
in python.
Is there anyone who can tell me how to show alerts?
Asked
Active
Viewed 1,435 times
-1

martineau
- 119,623
- 25
- 170
- 301

Reyan Mehmood
- 27
- 5
2 Answers
0
You can use tkinter.messagebox
to create a pop up that display an information, warning, or error
like:
tkinter.messagebox.showwarning(title = "Ooops",message = "Please choose another file")
More here:
tkinter.messagebox (Python 3 documentation)
Standard Dialogs (effbot tkinterbook)

martineau
- 119,623
- 25
- 170
- 301

Jean-Marc Volle
- 3,113
- 1
- 16
- 20
0
add this code:
from tkinter import messagebox as mb
if you want to show an error use this:
mb.showerror(title = "", message = "")
but if you want to show a warning use this:
mb.showwarning(title = "", message = "")

phorez
- 11
- 3