попробуйте Vpython
from visual import *
import sys
scene = display(title='square for python.su', width=600, height=600, center=(0,0,0), background=(0,0,0))
frame = shapes.rectangle(pos=(0,0),width=600, height=600)
extrusion(shape=frame)
curve(pos=frame.contour(0),color=color.red,)
square_w = 100
square_h = 100
i = 0
while i != 600 - square_w:
i+=1
square = shapes.rectangle(pos=(-300+square_w/2.+i,300-square_h/2.-i), width=square_w, height=square_w)
e = extrusion(shape=square, color=color.green)
c = curve(pos=square.contour(0),color=color.green)
rate(100)
c.visible = False
e.visible = False