E
E
Elick2021-07-22 21:36:20
Python
Elick, 2021-07-22 21:36:20

Is there a package for python that will allow you to enter text from the keyboard?

Suppose we have a Word open, using
import pyautogui as pg
pg.click (500,500,1)
I click on the screen and put the cursor on the sheet, after which I want to enter text by pressing the keyboard, how to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elick, 2021-07-22
@Elick

Wow, like this:

import pyautogui as pg  
import keyboard as kb
 
pg.click(250,250,1)

text = 'text'
for t in text:
    kb.press_and_release(t)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question