【发布时间】:2017-03-21 02:42:15
【问题描述】:
我在下面有一些代码在一个圆圈上画线,但在每次迭代期间这些线都不会被删除。有谁知道如何从窗口中删除对象?
我尝试了win.delete(l),但没有成功。谢谢。
import graphics
import math
win.setBackground("yellow")
x=0
y=0
x1=0
y1=0
P=graphics.Point(x,y)
r=150
win.setCoords(-250, -250, 250, 250)
for theta in range (360):
angle=math.radians(theta)
x1=r*math.cos(angle)
y1=r*math.sin(angle)
Q=graphics.Point(x1,y1)
l=graphics.Line(P,Q)
l.draw(win)
【问题讨论】:
标签: python graphics zelle-graphics