'Infinite loop with setting time of sleep
I want to set a sleep as a value from input, but it doesn't work:
import win32api, win32con, time
def jump(x,y):
x0, y0 = win32api.GetCursorPos()
win32api.SetCursorPos((x0+x,y0+y))
t = int(input("type time of sleepin [s]: "))
while True:
jump(10,10)
time.sleep(t)
Solution 1:[1]
A while loop (notice the name) executes while its condition is True:
while (condition):
# Code
So putting True as condition, you will have a neverending loop.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | FLAK-ZOSO |
