title: how to open a program in python and send keystrokes?
body: <p>I want to open a browser, click on some fields and then send keystrokes. </p>
  
  <p>The following code clicks at any point on screen. </p>
  
  <pre><code>win32api.SetCursorPos((x,y))
  win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
  win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
  </code></pre>
  
  <p>Now i want to send keystrokes to that active application. How can i do that?</p>