Python set String where the cursor is

Asked

Viewed 138 times

0

Good afternoon I need to set a string where the cursor is stopped.

Examples are: - Blinking cursor stopped in a notepad, play a string in the notepad. - Blinking cursor stopped in any input field, play a string in the input field.

How can I do this in Python?

1 answer

1

If I understand correctly, you can use the module pyautogui:

import pyautogui
pyautogui.typewrite('Stack Overflow em Português é demais!')

This will simulate keyboard input by typing the text where the cursor is positioned.

  • That would be it, solved

Browser other questions tagged

You are not signed in. Login or sign up in order to post.