How would I stop a while loop after n amount of time?
Asked by
Winnie Hsu
how would I stop a while loop after 20 seconds if it does not achieve what I want it to achieve.
like this:
from interruptingcow import timeout
try:
with timeout(60*5, exception=
while True:
except RuntimeError:
pass
-------
My Code is as Follows:
while not exists(A.png): #A.png=9999
mouseMove(
mouseDown(
else:
print("check!")
mouseUp()
p.s. I want to add from 0 until 9999, and don't want use click instead mouseDown,
hope someone can help me, thanks.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply:
To post a message you must log in.