2011-11-26 23 views

Respuesta

3

necesita cambiar el nombre de su pitón-shell original antes de la apertura de una nueva. Utilice M - xrename-buffer.

+0

simple y dulce – hatmatrix

3

Cambiar el nombre de la memoria intermedia no funciona para mí, pero se puede utilizar el tercer parámetro de run-python.

M - :(run-python nil nil t)RET

Desde la unión para cambiar a la memoria intermedia actual no es realmente útil puede recuperarse a algo más útil

(defun my-run-python (&optional new) 
    (interactive "P") 
    (if new 
    (run-python nil nil new) 
    (pop-to-buffer (process-buffer (python-proc)) t))) 

(define-key python-mode-map (kbd "C-c C-z") 'my-run-python) 

Y use C - cC - z para cambiar al intérprete pitón actual y C - uC - cC - z para cambiar a un intérprete de Python fresco.

+0

Gracias. Esto es genial, excepto que es para python loveshack y estoy usando 'python-mode'. Quería cambiar en algún momento, pero ahora estoy usando 'iPython', que parece solo compatible con' python-mode'. – hatmatrix

0

Al utilizar python-mode través python.el, que tiene un terminal de Python por tampón Python es el valor predeterminado.

Sin embargo, puede cambiar este comportamiento por defecto si lo que quiere es lugar para múltiples memorias intermedias de Python para compartir el mismo terminal de Python. Para ello, después de abrir el primer tampón Python, entre:

M-x python-set-proc 

... que está documentada:

Set the default value of `python-buffer' to correspond to this buffer. 
If the current buffer has a local value of `python-buffer', set the 
default (global) value to that. The associated Python process is the 
one that gets input from C-c C-r et al when used in a buffer that 
doesn't have a local value of `python-buffer'. 

Luego, más tarde, si quieres un nuevo buffer de Python para utilizar su propia concha, introduzca:

M-x set-variable python-buffer [RET] nil [RET] 

después de hacerlo y después la apertura de una nueva memoria intermedia Python, se creará un nuevo terminal de Python para ese búfer después de entrar en python-switch-to-python o C-c C-z.