I installed a win32com.client module win32com.client In it, you can make an imitation of keystrokes (A la Ctrl + C ):
shell = win32com.client.Dispatch('WScript.Shell') shell.SendKeys('^a^x') However, one very strange feature appeared in the process: all these imitations of pressing are launched in the background thread. In my case, this is unacceptable. How to make so that all program waited, while pressing will be simulated? I tried threading - it turned out, but the program is now instead of 0.1s. 3c works, which is unacceptable.
topor any other dispatcher and make sure), the system “sees” them quite normally - each thread, at least in CPython, has an OS thread. Moreover, new threads are generated not by some kind of magic, but by system libraries, for example, pthreads . - m9_psythreading? Unfortunately,multiprocessingdid not help. - garbart