Open second python interpreter in emacs

emacs, interpreter, python

Solution

`M-x describe-function` (RET) `run-python`:

run-python is an interactive compiled Lisp function in `python.el'.

(run-python &optional CMD NOSHOW NEW)

Run an inferior Python process, input and output via buffer Python. CMD is the Python command to run. NOSHOW non-nil means don't show the buffer automatically.

Interactively, a prefix arg means to prompt for the initial Python command line (default is `python-command').

A new process is started if one isn't running attached to `python-buffer', or if called from Lisp with non-nil arg NEW. Otherwise, if a process is already running in`python-buffer', switch to that buffer.

...

In the `*scratch*` buffer:

(run-python nil nil 't)

That will give you a new Inferior Python process.

You could code up a new interactive emacs command in your `.emacs` file, something like:

(defun my-run-python ()
  (interactive)
  (run-python nil nil 't))

Problem

How would I open a second python interpreter in emacs? I am using emacs 24.3 and Ubuntu 12.04 LTS. I have opened the SQL interpreter/program via a prefix argument of 2. I tried this with python and it did not work. Any suggestions and ideas are welcome. The mode in my current python interpreter buffer says: `Inferior Python: run Shell-Compile` I have downloaded python-mode 6.10 from ELPA the emacs package manager. Thanks for all the help!

Original source