<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body>
    <div class="moz-cite-prefix">On 2/15/21 5:56 AM, José Abílio Matos
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:3406251.R56niFO833@griffin">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">On
        Monday, February 15, 2021 4:27:40 AM WET Richard Kimberly Heck
        wrote:</p>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
        We have a Python detection routine, find_python_binary(), so it
        could be</p>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
        modified to check for those commands explicitly. I'm reluctant
        to touch</p>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
        that code myself though.</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">The
        detection code in LyX is working correctly, it works if the name
        is not python. The code searches for python39 or python3.9 or
        ...</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">The
        issue that Scott is raising is different. The problem is that
        configure.py always issue a "python" as the python name. When we
        get here the lyx detection code already worked correctly.</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">I
        had thought previously about this and I have an idea to fix
        this.</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">"""</p>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">import
        os, sys</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">print(os.path.basename(sys.executable))</p>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">"""</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">so
        the idea is to replace "python" by
        os.path.basename(sys.executable) in all the calls on
        configure.py.</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">This
        code is general, since it takes care of the directory
        separators, and it should work everywhere.</p>
      <br>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Funnily
        enough the function rescanTeXFiles (line 1920) already does
        that. :-)</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">For
        the next stable release if we assume a minimum of python 3.6 we
        can use the f-strings (formatted in case you wonder :-) ) and
        the code could be simply.</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">python
        = os.path.basename(sys.executable);</p>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">...</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">print
        (f"{python}")</p>
      <br>
      <p
        style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">so
        that the content of variable python is replaced inside the
        function...</p>
    </blockquote>
    <p>Well, José, you are the expert on this, so please go ahead. It
      probably would be good to have this for the next release (probably
      beta 1).</p>
    <p>Riki</p>
    <br>
  </body>
</html>