python default when I run a script

Help
joyotp
2006-01-05
2013-04-26
  • joyotp
    joyotp
    2006-01-05

    When I run a script /usr/bin/python -u ... is lauched.
    I want to change it with, for exemple, /usr/env python -u ...
    Is it possible ?

    Thanks

     
    • sys.executable is used.

      If you start DrPython with /usr/bin/python then
      this path is the value of it.

      Otherwise you could hack it:
      DrPython.py:
      (last line in
      def InitializeConstants(self):
      self.pythexec = <your python path>

       
    • joyotp
      joyotp
      2006-01-06

      Thank for your answer.

      In debian sid drpython doesn't work with python2.4, thus I can't use the first solution.

      The second solution is interesting but I don't like to have an hacked version of the code.

      Is it possible to change this value using a DrScript ? How (if you have the time for an answer)?

      Thank you again

       
    • I for myself changed some things, I don't like
      with a startup plugin, which is loaded by default.

      (Edit Indexes and add it to default.idx)

      You could take a look at it (my startup plugin)

      http://mitglied.lycos.de/drpython/Startup.py

      So in your case you could add something like:

      def Plugin(DrFrame):
      <tab>import sys
      <tab>sys.executable = '<your path>

       
    • It crosses my mind, that it is better to simply write:

      def Plugin(DrFrame):
          DrFrame.pythexec = "<your python exe path>"