<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#330033" bgcolor="#ffffff">
    On 3/8/2011 12:02 PM, Terry Reedy wrote:
    <blockquote cite="mid:il621e$320$1@dough.gmane.org" type="cite">On
      3/7/2011 9:31 PM, Reliable Domains wrote:
      <br>
      <br>
      <blockquote type="cite">The launcher need not be called
        "python.exe", and maybe it would be
        <br>
        better called #@launcher.exe (or similar, depending on its exact
        <br>
        function details).
        <br>
      </blockquote>
      <br>
      I do not know that the '#@' part is about, but pygo would be short
      and expressive.
      <br>
      <br>
    </blockquote>
    <br>
    If my proposal to make a line starting with #@ to be used instead of
    the Unix #! (#@ could be on the first or second line, to allow
    cross-platform scripts to use both, and Windows only scripts to not
    have #!), then #@launcher.exe (and #@launcherw.exe I suppose) would
    reflect the functionality of the launcher, which need not be tightly
    tied to Python, if it uses a separate line.&nbsp; But the launcher should
    probably not be the thing invoked from the command line, only
    implicitly when running scripts by naming them as the first thing on
    the command line.<br>
    <br>
    I'm of the opinion that attempting to parse a Unix #! line, and
    intuit what would be the equivalent on Windows is unnecessarily
    complex and error prone, and assumes that the variant systems are
    configured using the same guidelines (which the Python community may
    espouse, but may not be followed by all distributions, sysadmins, or
    users).&nbsp; That's why I propose a different line for Windows... it is
    as simple as the long-proven Unix #! line, but imposes no
    restrictions on or requirements that there be a #! line; it has more
    flexibility in that it could invoke different versions or provide
    different options on Unix and Windows if necessary for some
    environments.<br>
    <br>
    #!/usr/bin/env python2.6 -B<br>
    #@c:\python26\python2.6.exe<br>
    <br>
    or<br>
    <br>
    #!/usr/bin/python2.5<br>
    #@"C:\Program Files (x86)\IronPython 2.6 for .NET 4.0\ipy.exe"<br>
    <br>
    Now that I've had this idea, one might want to create other "2nd
    character" codes after the Unix #! line... one could have<br>
    <br>
    #! Unix command processor<br>
    #@ Windows command processor<br>
    #$ OS/2 command processor<br>
    #% Alternate Windows command processor.<br>
    <br>
    One could even port it to Unix:<br>
    <br>
    #!/usr/bin/#@launcher<br>
    #@c:\python2.6\python.exe<br>
    #^/usr/bin/python2.5<br>
    #&amp;/usr/bin/mono/IronPython2.6 for .NET 4.0/ipy.exe<br>
    #&nbsp; I made up the line above, having no knowledge of Mono, but I
    think you get the idea<br>
    <br>
    Choice of command line would be an environment variable, I suppose,
    that the launcher would look at, or if none, then a system-specific
    default.&nbsp; It would have to search forward in the file until it finds
    the appropriate prefix or a line not starting with #, or starting
    with "# " or "##", at which point it would give up.<br>
    <br>
  </body>
</html>