Open kif1205 opened 5 years ago
https://stackoverflow.com/questions/13293269/how-would-i-stop-a-while-loop-after-n-amount-of-time
from interruptingcow import timeout try: with timeout(60*5, exception=RuntimeError): while True: test = 0 if test == 5: break test = test - 1 except RuntimeError: pass
This way only works in linux , not working in Windows
https://stackoverflow.com/questions/13293269/how-would-i-stop-a-while-loop-after-n-amount-of-time
from interruptingcow import timeout try: with timeout(60*5, exception=RuntimeError): while True: test = 0 if test == 5: break test = test - 1 except RuntimeError: pass