python-mode and py-python-command 
Author Message
 python-mode and py-python-command

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?

1. With

set-variable

(You know, Lisp is super intuitive ;-)

2. With eval-expression I managed to

(setq py-python-command "/usr/bin/python2.1")

but it has no effect in the decision which Python to run :-(

3. What is wrong with this (at the end of file)?

% Local Variables:
% mode: python
% py-python-command: \"/usr/bin/python2.1\"
% End:

(do i need to put some control characters after End: ?)

Thank you!

Sincerely yours, Roman Suzi
--

_/ Wednesday, July 04, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "Mediocrity requires aloofness to preserve it's dignity" _/



Mon, 22 Dec 2003 03:02:22 GMT  
 python-mode and py-python-command

I think you're doing the right thing, but you have to try the new
setting out with a new emacs.  python-mode.el doesn't use the
value in py-python-command directly, but passes it into some other
variables, so just changing it will have no immediate effect.

Alex.



Mon, 22 Dec 2003 06:28:36 GMT  
 python-mode and py-python-command

Quote:

> 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"

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).

[...]

Quote:
> 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 {*filter*}on % as a comment character.

The following snippet shows how to set the variables including a
workaround for the buglet.

--------- snip --------
import sys
print sys.version[:3]

# Local variables:
# py-python-command: "python2.1"
# py-which-shell: "python1.5"
# End:
--------- snip --------

HTH
  Siggy

--

****** ceterum censeo javascriptum esse restrictam *******



Mon, 22 Dec 2003 07:21:34 GMT  
 python-mode and py-python-command

Quote:

>> 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!

Quote:
>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?

Quote:
>> 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 {*filter*}on % as a comment character.

It's not python file ;-)

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

_/ Thursday, July 05, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ ">From the Department of Redundancy Dept." _/



Mon, 22 Dec 2003 12:28:17 GMT  
 python-mode and py-python-command

Quote:



> >> 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).

Just checked out python-mode.el from the CVS tree. As cvs annotate
shows, the problem has been fixed since long in $Revision: 3.103$
<sic>.

To whomever it concerns:
   Where does the broken 3.105 come from?

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

Toggling is meant for switching between CPython and JPython
interpreters, but I guess you can abuse py-jpython-command.

Regards
  Siggy

--

****** ceterum censeo javascriptum esse restrictam *******



Mon, 22 Dec 2003 20:09:46 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Finding out that Python is in interactive mode in sitecustomize.py

2. REPOST: Finding out that Python is in interactive mode in sitecustomize.py

3. fintl.py -- a python module to aid i18n (was Re: International Python)

4. dumping command-history in python interactive mode

5. python-mode - running a script that takes command line arguments

6. syntax-error with new Python 2.1 and pyFTPd.py and pyFTPdrop.py

7. python 1.5.2 cgi.py and os.py error

8. Xemacs & font-lock-mode in python-mode

9. (X)Emacs, python-mode, mmm-mode, and Spyce

10. Python Install-Installed Python 2 on top of python 1.5

11. Python module templates (was python calling python)

12. ANNOUNCE: quality assurance: another python lint (and python parsing in python)

 

 
Powered by phpBB® Forum Software