Function: run-python
run-python is an autoloaded, interactive and byte-compiled function
defined in python.el.gz.
Signature
(run-python &optional CMD DEDICATED SHOW)
Documentation
Run an inferior Python process.
Argument CMD defaults to python-shell-calculate-command return
value. When called interactively with prefix-arg, it allows
the user to edit such value and choose whether the interpreter
should be DEDICATED for the current buffer. When numeric prefix
arg is other than 0 or 4 do not SHOW.
For a given buffer and same values of DEDICATED, if a process is already running for it, it will do nothing. This means that if the current buffer is using a global process, the user is still able to switch it to use a dedicated one.
Runs the hook inferior-python-mode-hook after
comint-mode-hook is run. (Type C-h m (describe-mode) in the
process buffer for a list of commands.)
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
;;;###autoload
(defun run-python (&optional cmd dedicated show)
"Run an inferior Python process.
Argument CMD defaults to `python-shell-calculate-command' return
value. When called interactively with `prefix-arg', it allows
the user to edit such value and choose whether the interpreter
should be DEDICATED for the current buffer. When numeric prefix
arg is other than 0 or 4 do not SHOW.
For a given buffer and same values of DEDICATED, if a process is
already running for it, it will do nothing. This means that if
the current buffer is using a global process, the user is still
able to switch it to use a dedicated one.
Runs the hook `inferior-python-mode-hook' after
`comint-mode-hook' is run. (Type \\[describe-mode] in the
process buffer for a list of commands.)"
(interactive
(if current-prefix-arg
(list
(read-shell-command "Run Python: " (python-shell-calculate-command))
(y-or-n-p "Make dedicated process? ")
(= (prefix-numeric-value current-prefix-arg) 4))
(list (python-shell-calculate-command) nil t)))
(let ((buffer
(python-shell-make-comint
(or cmd (python-shell-calculate-command))
(python-shell-get-process-name dedicated) show)))
(get-buffer-process buffer)))