How to quit a Windows GUI program gracefully with Python under Cygwin?

KB kbchung at
Fri Aug 12 12:07:02 CEST 2005


After I confirmed 'Alt-F4' would terminate and close a win32
application running independently,
I installed 'SendKeys' module and tested with the following code under
both Cygwin and Python Windows

import os, SendKeys
os.system('program datafile')
    {PAUSE 0.25}

What happened was that the 'program' ran correctly, but it stayed, not
closing the window
under Cygwin and Python Windows.  So it seems to me that this does not

One more thing: How do I control the pause time if I do not know the
time of an application?

Thanks in advance.


More information about the Python-list mailing list