pywinauto Application module conflicts with mouse library

29 Views Asked by At

I am working on an application to export OneNote Tables intro excel format. Code is pretty basic, just clicking in certain spots. However, if I load pywinauto library, my positions become shifted with aprox. 70 pixels on X and 30 pixels on Y.

What causes this offset/shift? I am using Spyder IDE if this matters.

Steps to reproduce the error:

  • run with pywinauto commented first,
  • pick a place on the monitor, check value for that place
  • rerun the code with pywinauto loaded, check same place for value for X,Y
import mouse
#from pywinauto import Application #aducem in prim plan aplicatia OneNote



while True:
    current_pos = mouse.get_position()
    print(current_pos)

Coordonates on a random spot before loading pywinauto Coordonates before pywinauto

Coordonates on a random spot after loading pywinauto Coordonates after pywinauto

I tried to use pywinauto to be sure my OneNote document is in focus, so I can click the export button. I was expecting to run smoothly, without any offset of the mouse position.

0

There are 0 best solutions below