C-c C-c
バッファまたはファイルを編集し、ヒットしてファイルをIPythonセッションに送信したいと思います。を介して実行するM-x py-shell
前に最初に実行すれば、これを達成できます。しかし、私が経由して機能をアドバイスしようとするとpy-execute-buffer
C-c C-c
(defadvice py-execute-buffer (before open-py-shell-first)
(let ((remember-window (selected-window))
(remember-point (point)))
(generate-new-buffer "*Python*")
(call-interactively 'py-shell)
(select-window remember-window)
(goto-char remember-point)))
(ad-activate 'py-execute-buffer)
エラーが発生します:
## working on region in file /var/folders/6o/6o08knx-FVOhrvCbYyrRDU+++TI/-Tmp-/python-29189FKe.py...
Python 2.7.1 (r271:86832, Feb 5 2011, 13:58:58)
Type "copyright", "credits" or "license" for more information.
IPython 0.10.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: ---------------------------------------------------------------------------
IOError Traceback (most recent call last)
/Users/aresnick/Desktop/<ipython console> in <module>()
IOError: [Errno 2] No such file or directory: '/var/folders/6o/6o08knx-FVOhrvCbYyrRDU+++TI/-Tmp-/python-29189FKe.py'
In [2]:
作成された一時ファイルがIPythonに表示されていないように見えますか?Pythonファイルに戻って再実行するpy-execute-buffer
と、すべて問題ありません。
どんな考えでもありがたいです-ありがとう!