Send the active program an alt-f4.  I do this through shell.send keys.
Hope this was of help.

KB wrote:
> Hi,
>
> I want to write a Python script that controls and automates a Windows
> GUI computation program.
>
> My problem is that I do not know how to quit the Windows GUI program
> gracefully with a command (program's or Python) in Cygwin.  'kill' or
> CTRL-C command in Cygwin does not finish it gracefully, meaning that
> some outputs do not come out normally.  The only thing I know is to
> click 'File-Exit' menu, but
> this requires a manual intervention that prevents scripting.
>
> Is there a way to quit a Windows GUI program gracefully with Python
> under Cygwin, of course, after the program finishes
> normal execution?
> 
> Thanks,
> 
> KB

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to