import pyautogui, time, threading, keyboard, msvcrt
global active, exitp
active = False
exitp = False
Names = []
def mainLoop():
global active, exitp
pressedkey = msvcrt.getch()
while True:
if pressedkey == 'z':
active = not active
elif pressedkey == 'x':
exitp = False
break
def running():
global exitp
while not exitp:
print("Running")
time.sleep(3)
start = time.time()
print("Your screen size is: " + str(pyautogui.size()))
width, height = pyautogui.size()
t1 = threading.Thread(target=mainLoop, args=())
t2 = threading.Thread(target=running, args=())
t1.start()
t2.start()
while not exitp:
if active:
pyautogui.click(90, height - 110)
for i in range(len(Names)):
if active:
pyautogui.typewrite(Names)
pyautogui.press("enter")
else:
break
active = False
end = time.time()
print("Execution time: " + str(end-start) + " seconds")
пытается создать цикл, который завершается, когда я нажимаю 'x', и набирает / прекращает вводить имена из моего массива, называемые "Имена", когда нажимаю "z", однако я нажимаю и "x", и "z" но они ничего не помогают?