python-mode and py-python-command

Roman Suzi rnd at onego.ru
Thu Jul 5 00:28:17 EDT 2001


On 5 Jul 2001, Siggy Brentrup wrote:

>Roman Suzi <rnd at onego.ru> writes:
>
>> Hello!
>>
>> How do I tell Emacs to call specific Python interpreter
>> within a certain file with Python code?
>>
>> I know that for this I need to set up py-python-command
>> variable, but how to do it?
>
>Which version of py-mode.el are you using (C-h v py-version)?
>On my system it shows
>
>  Value: "3.105"

Exactly this!

>That version is slightly broken, it runs the Python interpreter
>in the py-which-shell buffer-local variable. This variable is set from
>py-python-command on M-1 C-c C-t (py-toggle-shells).

So, toggling between, say, 1.5.2. and 2.1 is impossible?

>> 3. What is wrong with this (at the end of file)?
>>
>> % Local Variables:
>> % mode: python
>> % py-python-command: \"/usr/bin/python2.1\"
>> % End:
>
>Python will choke on % as a comment character.

It's not python file ;-)

>The following snippet shows how to set the variables including a
>workaround for the buglet.
>
>--------- snip --------
>import sys
>print sys.version[:3]
>^L
># Local variables:
># py-python-command: "python2.1"
># py-which-shell: "python1.5"
># End:

Thank you! This helps.

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Thursday, July 05, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ ">From the Department of Redundancy Dept." _/





More information about the Python-list mailing list