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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -