# 居中
margin = 50
canvas.create_rectangle(margin, margin, canvasWidth - margin, canvasHeight - margin, fill='lightgreen')
# 居中的其他方式
(cx, cy) = (canvasWidth // 2, canvasHeight // 2)
(rectWidth, rectHeight) = (100, 60)
canvas.create_rectangle(cx - rectWidth / 2, cy - rectHeight / 2, cx + rectWidth / 2, cy + rectHeight / 2, fill='red')