Skip to content

Instantly share code, notes, and snippets.

@mujeebishaque
Last active January 29, 2020 06:37
Show Gist options
  • Save mujeebishaque/3b81225a6f830c4b0c46d4469ed33079 to your computer and use it in GitHub Desktop.
Save mujeebishaque/3b81225a6f830c4b0c46d4469ed33079 to your computer and use it in GitHub Desktop.
import tkinter
from tkinter import messagebox
main_window = tkinter.Tk()
main_window.withdraw() #remove the background window.
messagebox.showinfo('Title', "This is just a text in a message box")
messagebox.showerror('ERROR!', "Here are the details of the error that you faced right now.")
messagebox.showwarning("WARNING!", "This will only have a button with ok as text or content.")
messagebox.askyesno("Confirmation", "Do you really want to close the application.")
messagebox.askokcancel("Confirm Action", "Do you want to proceed or cancel the operation?")
messagebox.askretrycancel("Confirm Action", "Installation Failed, retry or cancel the operation?")
>funnctions
showinfo()
showwarning()
showerror ()
askquestion()
askokcancel()
askyesno ()
askretrycancel ()
@mujeebishaque
Copy link
Author

user_choice = messagebox.askokcancel():

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment