Emacs: how to start a local python interpreter when editing a remote python file via tramp

In Emacs, when I start python using C-c !when editing a remote python file (using tramp - plinkx: on windows), the python interpreter runs on the remote host.

Is there a way to edit a remote python file and run a local python interpreter?

I am using python-mode (and not default python.el)

+5
source share
1 answer

python-mode 'make-comint, 'start-file-process, 'default-directory. , , .

-, 'default-directory , :

(add-hook 'python-mode-hook (lambda () (setq default-directory "~"))

, C-x C-f - ( ~).

'default-directory 'py-shell, ():

(defadvice py-shell (around py-shell-different-directory activate)
  "set default-directory just for py-shell"
  (let ((default-directory "~"))
    ad-do-it))
+1

All Articles