2

Ubuntu 13.04でemacs 24.3.1、Python 2.7.4、IPython 0.13.2を使用して、EmacsでIPythonを実行しようとしています

Emacs 内で IPython シェルを起動すると、デフォルトで $HOME ディレクトリになります。によって現在の作業ディレクトリに変更しようとしました'cd', 'import os, os.chdir()'が、コードのスニペットを実行した後、作業ディレクトリは常に $HOME に戻ります。

作業ディレクトリを変更する方法や、編集した python ファイルのディレクトリと同じように Ipython シェルを起動する方法はありますか? ありがとう。

同様の質問Setting the working directory of IPython Shell to that of the python file being running in Canopy but not know how to implement in Emacs...を見つけました。

4

1 に答える 1

0

Ubuntu で利用できるはずの python-mode.el を使用します。

Mx IPython 経由で IPython を実行する

この場合に適用されるカスタマイズ:

py-execute-directory

設定すると、py-execute-... 関数が動作するファイルのデフォルトのディレクトリ名が保存されます。

それぞれ

py-use-current-dir-when-execute-p

t', current directory is used by Python-shell for output ofpy-execute-buffer' および関連コマンドの場合。

于 2013-09-15T07:19:39.053 に答える