Best Messagebox features in python
Kaveh Sabouri
Posted on March 6, 2022
Features we want teach you on this post:
- Show warning
- Show error
- Ask cancel
- Ask yes no
- Ask retry cancel
1.Show warning
from tkinter import *
from tkinter import messagebox
window = Tk()
messagebox.showwarning("Warning","Warning")
window.mainloop()
output:
2.Show error
from tkinter import *
from tkinter import messagebox
window = Tk()
messagebox.showerror("Error","Error")
window.mainloop()
output:
3.Ask cancel
from tkinter import *
from tkinter import messagebox
window = Tk()
messagebox.askokcancel("askokcancel","askokcancel")
window.mainloop()
output:
4.Ask yes no
from tkinter import *
from tkinter import messagebox
window = Tk()
messagebox.askyesno("askyesno","askyesno")
window.mainloop()
output:
5.Ask retry cancel
from tkinter import *
from tkinter import messagebox
window = Tk()
messagebox.askretrycancel("askretrycancel","askretrycancel")
window.mainloop()
output:
1.Like
2.Comment
3.Follow me
💖 💪 🙅 🚩
Kaveh Sabouri
Posted on March 6, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.