On 12 May 2000, Bastian Kleineidam said:
Do we have always Python scripts? What about shell scripts, and specifically Windows Batch scripts? See below for my current "Windows" hack in setup.py.
Good point -- it would be nice to use 'scripts' for shell scripts, MS-DOG batch files, and Python scripts. But I bet you can do a fair job of distinguishing those three by looking at a mix of extensions and #! line; and if you can't figure something out, assume it's a Python script.
The "first python on the path" is the correct thing for the user, otherwise the path is wrong. So "/usr/bin/env pyton" yields the correct interpreter to execute.
Not at all! Two possible scenarios come to mind: * I live life on the edge, so Python 1.6a2 is my "default" Python, but I'm installing something for a bunch of other users -- so it should use Python 1.5.2. Then I would run (eg.) python-1.5.2 setup.py install ...and I would damn well expect that any scripts installed by that distribution would (by default) be run by the Python 1.5.2 interpreter that I used to build/install the application. * I don't live life on the edge, so Python 1.5.2 is my default Python. But I've just downloaded some cutting-edge toy that requires 1.6 Then I would run (eg.) python-1.6a2 setup.py install ...and again, I would certainly expect any scripts installed by this distribution to be run by my Python 1.6 interpreter. And the arguments against always relying on #!/usr/bin/env are compelling -- I have long suspected it's a bit dodgy to rely on that across Unices, and the other posts in this thread confirm my paranoia. (With Unix, things are never as bad as they seem -- they're worse.) (Oh yeah, that's true for all operating systems...) Greg -- Greg Ward - Linux nerd gward@python.net http://starship.python.net/~gward/ I want you to MEMORIZE the collected poems of EDNA ST VINCENT MILLAY ... BACKWARDS!!