python in Emacs (windows)

David Robinow drobinow at gmail.com
Wed Apr 22 11:21:04 EDT 2009


On Wed, Apr 22, 2009 at 3:52 AM, Mark Zweers <zweers.mark at gmail.com> wrote:
> Hi!
>
> I'm trying to run python from within Emacs. This is in my .emacs file :
>
> (setq auto-mode-alist ; trigger python mode automatically
>        (cons '("\\.py$" . python-mode) auto-mode-alist))
> (setq interpreter-mode-alist
>        (cons '("python" . python-mode)
>         interpreter-mode-alist))
> (autoload 'python-mode "python-mode" "Python editing mode." t)
>
> , but I got this message :
>
> "Searching for program: no such file or directory, python"
>
> So I've added the following line :
>
> (setq py-python-command '("C:/Program Files/Python"))
>
> This is the path where my 'python.exe' is located. But then this message
> occurs:
>
> Using the CPython shell
> let: Wrong type argument: integerp, "C:/Program Files/Python"
>
> Could anyone tell me how to solve this? Thanks a lot in advance!
>
> Mark
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
1: Try:
   (setq py-python-command "C:/Program Files/Python")

2: Putting your python in "Program Files" is demented.

3. If you put python in your PATH you don't have to set the variable
at all. (Not necessarily recommended, but it's an option.)

4. python-mode supports customize. That might be less error-prone than
trying to set py-python-command in your .emacs

5. Are you aware that emacs comes with a python mode? (python.el in
lisp/progmodes).
Not that it's necessarily better, but I'm curious why you rejected it
for a mode that you don't know how to use.



More information about the Python-list mailing list