Well on Windows I used some time ago for similar tasks the wmi module. It is able to analyse running programs, press buttons and activate menu items. As you didn't mention it, you might have a look at it. It works pretty well.
http://tgolden.sc.sabren.com/python/wmi.html For linux I don't know. -- http://mail.python.org/mailman/listinfo/python-list