0
How to pause while loop without using sleep function?
Do you guys know how to pause a loop and then when I press a key the loop continues? Is it even possible when using python?
3 Answers
0
Hi!
If you put an input() inside a while True: statement, it wait for you to put an input. And it start when you hit âEnterâ So that depeneds what you mean...
A code link to your code maybe is a start...
Regatds / Per B đ
0
Here's the code Per Bratthammar:
import win32api
import pyautogui
import win32con
while True:
   get = win32api.GetKeyState(win32con.VK_RBUTTON)
   if get < 1:
       pyautogui.rightClick()
   if win32api.GetKeyState(win32con.VK_XBUTTON1):
        #some code here to stop it
   if win32api.GetKeyState(win32con.VK_XBUTTON2):
       continue
0
Mayby some inspiration or ideas from this site:
https://www.python-course.eu/tkinter_events_binds.php