'use the macro several times and not only one's

def Macro():
    while True:
        try:
            if keyboard.is_pressed(Macrokey):
                keyboard.press(Firstkey)
                time.sleep(0.2)
                keyboard.press(Secondkey)
                break
        except:
            break
Macro()

The program finish after one use (Process finished with exit code 0) but i want it to use more than one time



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source