I am new to Python and am trying to send a combination of key strokes to an application I open under Windows 7. While my script will work flawlessly when I invoke Notepad.ex
I know this was asked 6 years ago, but someone might be with the same problem, so here is a possible solution:
shell.AppActivate('Put_The_Name_Here')
The code above will select the program, file, etc that is opened but not activated, that, maybe, is your problem.
Hope this helps someone!