我试图在 python 图形中同时移动两个对象(这似乎是指John Zelle 的 graphics.py),然后循环重复移动。但是,当我尝试循环它时,形状会消失。我怎样才能解决这个问题?
def main():
win = GraphWin('Lab Four', 400, 400)
c = Circle(Point(100, 50), 40)
c.draw(win)
c.setFill('red')
s = Rectangle(Point(300, 300), Point(350, 350))
s.draw(win)
s.setFill('blue')
s.getCenter()
while not c.getCenter() == Circle(Point(400, 50), 40):
c.move(10, 0)
s.move(-10, 0)
win.getMouse
while not (win.checkMouse()):
continue
win.close()