Python: Get caret position [closed]
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Improve this question I'm trying to get the caret position in Python. I tried using win32gui.GetCaretPos() but it always returns 0,0. Do you have any ideas how to make it work? Thanks Chris 回答1: If the caret is in a window created by another thread, you need to call AttachThreadInput.