I have a window that is opened up in a Python script (NOT THROUGH Tkinter), and all I want is to send an "enter" (keypress) command to that window. I was hoping I could do this with Tkinter, but I'm at a bit of a loss as to how to send this command to the current focused window.
Asked
Active
Viewed 265 times
2 Answers
0
You cannot do this with Tkinter. Tkinter can only send events to its own windows.

Bryan Oakley
- 370,779
- 53
- 539
- 685
0
You do not mention what OS you need this on.
If you need this on Windows only (not cross platform) then you want to use the Win32 API call to windll.user32.SendInput(). No time to create example code, but these two links should have what you need...
http://www.rutherfurd.net/python/sendkeys/
also:

Community
- 1
- 1