On Jul 24, 2006, at 11:17 AM, Christopher Barker wrote: > Ronald Oussoren wrote: >> Why's that? The directory that contains the script is a lot more >> useful >> for most scripts. > Bob Ippolito wrote: >> No, it's not. There are approximately zero scripts that expect this >> behavior. > > Most "scripts" I've ever used are used from the command line, and the > working dir is the working dir you call the command from. This pretty > much all goes to heck when you want to click on it from a GUI.
It doesn't have to. > All the Linux GUIs I've used use $HOME as the default working dir when > you double click on something. > > When a script is installed somewhere central, like /usr/local/bin, > that's really all that makes sense. That's clearly irrelevant, because people aren't going to be double- clicking on files that you have to do "magic incantations" to even see from Finder. > When a script is hanging out in the depths of someone's $HOME > hierarchy > somewhere, I suppose it's likely that the user will want the script to > act on files nearby. > > I'm not going to push the point -- I don't find PythonLauncher useful, > for just this reason. I think if you have something that behaves > like a > traditional *nix script, you're better off running it from the command > line. If you have a little GUI, you're probably better off making an > Applet out of it, and clicking on it that way. And in that case, I'd > want $HOME as the default working dir. But why would you want $HOME as the default working dir? There doesn't seem to be any purpose to it. Scripts that reference files in your home directory are always going to do that with an absolute path. I have never in my life seen a script that must be started with a working directory of $HOME (unless it also lives there). It is however extremely common for scripts to require that they are run from the directory they live in. Proper applications on OS X are going to start you with a working directory of / and must *always* use absolute paths. py2app assumes a working directory of the Resources folder (where the script and its data files live), because it makes more apps work without breaking any that were built for the normal behavior. This is the same scenario; by changing this we become compatible with Windows behavior, so we make more scripts work. We don't break anything. > Can you drag-and-drop on a script and have PythonLauncher do argv > emulation for you? That could be useful. I don't think so. -bob _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig