message box in Python code example
Example 1: python tkinter messagebox
import tkinter
from tkinter import messagebox
root = tkinter.Tk()
messagebox.showerror("Error", "Error message")
messagebox.showwarning("Warning","Warning message")
messagebox.showinfo("Information","Informative message")
Example 2: tkinter info box
from tkinter import messagebox
messagebox.showinfo('Title', 'Information')
Example 3: list in tkinter messagebox
from tkinter import *
from tkinter import messagebox
def listMessageBox(arr):
window=Tk()
listbox=Listbox(window)
listbox.pack(fill=BOTH, expand=1)
[listbox.insert(END, row) for row in arr]
window.mainloop()
arr=['a','b','c','1','2','3']
listMessageBox(arr)
Example 4: messagebox python
from tkinter import messageboxmessagebox.showinfo("Title", "a Tk MessageBox")