-1

I want to show alerts in tkinter in python. Is there anyone who can tell me how to show alerts?

martineau
  • 119,623
  • 25
  • 170
  • 301

2 Answers2

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