from tkinter import * def clicked(): x = (250 - 50)/2 y = (250 - 50)/2 cv.create_rectangle(x,y,x+50,y+50, fill="#80CBC4") root = Tk() root.title("Приложение на Tkinter") root.geometry("500x500") cv = Canvas(bg="white", width=250, height=250) cv.pack() label = Button(text="Квадрат по центру холста",command=clicked) label.pack() root.mainloop()