show message box within function tkinter code example
Example: error warning tkinter
from tkinter import messagebox
messagebox.showerror("Title", "Message")
from tkinter import messagebox
messagebox.showerror("Title", "Message")