#
#
# .2020-08-27 20:44:38
Python
# ., 2020-08-27 20:44:38

How to write the copied text to a variable?

The user copies any text, in any application. The program writes this text to a variable. How to implement this in Python?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gennady S, 2020-08-27
@andro1

If you do not want to use the operating system API, it is easier to check the contents of the clipboard by timer: https://pypi.org/project/pyperclip/
If you are ready to dive, you can use https://github.com/mhammond/pywin32 and dig in this direction : https://docs.microsoft.com/ru-ru/windows/win32/api... subscribe your window (alas, you will need it too) to the event https://docs.microsoft.com/en-us/ windows/win32/dat...
Perhaps there is a ready-made library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question