Tkinter एप्लिकेशन बनाने और develop करने के लिए एक लोकप्रिय Python library है। इसमें विभिन्न methods और functions हैं जिनका उपयोग एप्लिकेशन में multiple features add करने के लिए किया जा सकता है। Tkinter का उपयोग करके, हम dialogue boxes और अन्य widgets बना सकते हैं।
इस लेख में, हम देखेंगे कि कैसे एक simple message box बनाया जाए जो pop up होकर कुछ information display करे और option select करे।
उदाहरण
# Import the required libraries
from tkinter import *
from tkinter import messagebox
# Create an instance of tkinter frame or window
win = Tk()
# Set the geometry
win.geometry("700x100")
# Define the function for button
def pop_up():
messagebox.showerror("Error! Please check and correct.")
messagebox.showwarning("Warning! You can not proceed.")
# Create a button
Button(win, text="Click", command=pop_up).pack(pady=20)
# Keep Running the window
win.mainloop()
आउटपुट
उपरोक्त code चलाने से निम्न window produce होगी।

यदि आप "Click" button पर क्लिक करते हैं, तो निम्न error message pop up होगा।

फिर, यदि आप "OK" button पर क्लिक करते हैं, तो निम्न warning message pop up होगा।
