0

When running this .py script, it doesn't return any error and does print "Click." but it doesn't actually click.

import os, sys
import time
import win32api, win32con

def leftClick():
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
    time.sleep(.1)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)
    print "Click."    

def main():
    leftClick()

if __name__ == '__main__':
    main()

Is there anything I am doing wrong here?

Koala
  • 5,253
  • 4
  • 25
  • 34

0 Answers0