[Pythonmac-SIG] Problems simulating command-line arguments

John W Baxter jwblist@olympus.net
Thu, 19 Sep 2002 22:50:34 -0700


At 13:54 -0700 9/18/2002, Robin Siebler wrote:
>When I try to simulate command-line arguments by holding down the option
>key and double-clicking on a script, I am getting the following behavior:
>
>1.  The finder window containing the script immediately closes.  I find
>this *highly* annoying.  Is this a known bug, or something I can turn off?
It's how Finder works and has worked for many years (to sometime in the mid
1980s, I think).  It does get in the way of using the Option key for things
like this.  The key is to hit Option late enough so Finder doesn't see it,
but early enough that the application does...there's a fair amount of room,
see below.

>2.  75% of the time, the interpreter launches without the dialog (where
>command-line arguments can be set) appearing.
>3.  25% of the time, the dialog appears and I am able to set the
>command-line arguments.
I don't know for sure, but here's a guess:  you aren't holding down Option
long enough, and by the time the code is loaded and has a chance to look at
the modifier keys, the Option key is up.  That's what happens in
non-Pythonic venues...there's a good chance it does here, too.  It's been a
few years since I needed to deal with command line arguments in MacPython.

Unfortunately, this is essentially an unteachable skill in the world of
programs for distribution, so you need to do something else in that world.
It's not hard to learn for yourself.

  --John
-- 
John Baxter   jwblist@olympus.net      Port Ludlow, WA, USA