python tkinter rectangle code example
Example 1: rectangle in tkinter
from tkinter import *
root = Tk()
c = Canvas(root)
c.pack()
c.create_rectangle(100, 100, 200, 200)
root.mainloop()
Example 2: python tkinter messagebox
import tkinter
from tkinter import messagebox
# hide main window
root = tkinter.Tk()
# message box display
messagebox.showerror("Error", "Error message")
messagebox.showwarning("Warning","Warning message")
messagebox.showinfo("Information","Informative message")