D
D
Dmitry2020-08-09 17:49:58
Python
Dmitry, 2020-08-09 17:49:58

How to execute multiple functions at the same time in python?

Now there are two functions how to start their execution in a loop and interrupt the execution of the first one if the second condition is met, now the only thought is to put the content in endless loops and start executing

what is:

def fishing():
    pyautogui.keyDown('space')
    time.sleep(1.65)
    pyautogui.keyUp('space')
    time.sleep(3)
    x = 0
    while x != 35:
        pyautogui.keyDown('space')
        time.sleep(1)
        pyautogui.keyUp('space')
        x += 1
        continue
    pyautogui.keyDown('space')
    time.sleep(15)
    pyautogui.keyUp('space')

def its_fish():
    if pyautogui.locateOnScreen('qwe.PNG') == None:
        print("рыбы нет")
    else:
        pyautogui.click(x=130, y=801)
        pyautogui.click(pyautogui.locateCenterOnScreen('qwe.PNG'))
        print('Опа Рыбка')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Tikhonov, 2020-08-10
@tumbler

862953d3d06f5183ade60d99415ab226.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question