python default when I run a script

  • 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 ?


    • Franz Steinhaeusler

      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:
      (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

    • Franz Steinhaeusler

      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)

      So in your case you could add something like:

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

    • Franz Steinhaeusler

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

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


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks