I'm trying to figure out how to specify which version of python to run when calling "run-python" (C-c C-p) in python-mode, and I've run into the following problem. These are the first few lines of the definition of run-python:
(defun run-python (cmd &optional dedicated show)
"Run an inferior Python process. Input and output via buffer named after `python-shell-buffer-name'. If there is a process already running in that buffer, just switch to it.
With argument, allows you to define CMD so you can edit the command used to call the interpreter and define DEDICATED, so a dedicated process for the current buffer is open. When numeric prefix arg is other than 0 or 4 do not SHOW.
I would like to specify the CMD argument so as to specify "python2" or "python3." For example, I've tried things like
M-: (run-python python2)
M-: (run-python (shell-command "/usr/bin/python2"))
but nothing works.
Edit: I figured out that if I supply 0 as a numeric argument, then there is a prompt where I can specify the python version. I would still like to know why neither of my attempts to specify CMD in the actual function call did not work though.