following pynput documentation I tried this to "cut":
1: select some text in an editor
2: run this_code.py using a shortcut (without leaving the active windows)
from pynput.keyboard import Key, Controller
keyboard = Controller()
with keyboard.pressed(Key.ctrl):
keyboard.press('x')
keyboard.release('x')
The python console open actually print: ^X. The combination of keys are right but it doesn't do what it's suppose to do: cut the selected text store it in the clipboard. (I'm not interested to just store the clipboard content in a variable, I want a Ctrl+C)
I guess this answser will also solve the remaining part: Ctrl+V (to past some data which will be first inserted in the clipboard)