| Store | Cart

detecting launching from explorer

From: Scott Roland <scat...@gmail.com>
Fri, 16 Feb 2007 17:06:20 +0100
I have a python script that can either be launched from cygwin, a DOS
cmd.exe shell, or by double clicking on the icon in a Windows Explorer
window.

When it is launched by double clicking from a Windows Explorer window it
opens up a new cmd.exe window to run the program and the window closes
when it is done. I would like to be able pause at the end of execution
in this new window and wait for a key press, so that the user can see
what is in the window before it closes. I can check platform.system, and
make sure that I don't do this in cygwin, but how can I not make the
program pause for a key press when the script was launched from the
command line?

At the moment I have created a shortcut that passes an argument to the
script, but I was hoping for a solution that doesn't involve editing the
shortcut.
-- 
Scott Roland

Recent Messages in this Thread
Scott Roland Feb 16, 2007 04:06 pm
Trent Mick Feb 16, 2007 05:34 pm
Messages in this thread