Function: python-shell-get-or-create-process

python-shell-get-or-create-process is a byte-compiled function defined in python.el.gz.

This function is obsolete since 25.1; Instead call python-shell-get-process and create one if returns nil.

Signature

(python-shell-get-or-create-process &optional CMD DEDICATED SHOW)

Documentation

Get or create an inferior Python process for current buffer and return it.

Arguments CMD, DEDICATED and SHOW are those of run-python and are used to start the shell. If those arguments are not provided, run-python is called interactively and the user will be asked for their values.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-shell-get-or-create-process (&optional cmd dedicated show)
  "Get or create an inferior Python process for current buffer and return it.
Arguments CMD, DEDICATED and SHOW are those of `run-python' and
are used to start the shell.  If those arguments are not
provided, `run-python' is called interactively and the user will
be asked for their values."
  (let ((shell-process (python-shell-get-process)))
    (when (not shell-process)
      (if (not cmd)
          ;; XXX: Refactor code such that calling `run-python'
          ;; interactively is not needed anymore.
          (call-interactively 'run-python)
        (run-python cmd dedicated show)))
    (or shell-process (python-shell-get-process))))