Y
Y
ygg_712022-02-08 11:35:17
Python
ygg_71, 2022-02-08 11:35:17

Is it possible to make a binding in a window, script execution in the background?

mport keyboard
import time

path_to_base = input("Path to base: ")
col = input("col: ")
timeout = input("Timeout: ")

file = open(path_to_base, encoding="utf-8")

time.sleep (5)

for i in range(int(col)):
message = file.readline().replace("\n", "")
if message !="":
keyboard.write(message, delay=0)
keyboard .press("Enter")
time.sleep(float(timeout))

There is a code that prints different words from a file, can it be made so that it is tied to the browser so that you can run it and do other things while it prints ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-02-08
@ygg_71

It is impossible, the keyboard monitors / imitates the operation of the keyboard, and where the events then fall is not of interest to him.
Look towards pywinauto.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question