How do you break a for loop in python using a mouseclick -
i have loop makes rectangle follow path of circle 10 rotations.
theta in range(0, 3600): rect.undraw() nrcx=(cent.getx()+(r*(math.cos(math.radians(theta))))) nrcy=(cent.gety()+(r*(math.sin(math.radians(theta))))) c1=point((nrcx-b), (nrcy-b2)) c2=point((nrcx+b), (nrcy+b2)) rect=rectangle(c1, c2) rect.setfill("red") rect.setoutline("red") rect.draw(win) time.sleep(.05)
however need when click during loop going, stop , rectangle follow along path in clock-wise instead of counter-clockwise. possible?
Comments
Post a Comment