Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
bravo's blog
[go: Go Back, main page]

bravo's blog

マルチプラットフォームGUIツールキット+軽量言語であるPyQtのプログラミングとか | Pythonのお仕事も募集してます(twitter @bravotanからDMできます)

端末内のEmacsとIPythonをなんとか綺麗に連携させる

IPythonを端末内のEmacsでも綺麗に見えるようにしたい

f:id:bravo:20161106191459p:plain

端末内のEmacsPython Mode https://launchpad.net/python-mode を使っていて、IPythonと連携しようとしても素のままだとエスケープシーケンスがこぼれて綺麗に見えないので、.emacsなりで以下のように設定を変えておくと綺麗になりました。ついでにshebang(#!)がどうなっていてもipythonにする設定も含めています。

(when (executable-find "ipython") ;; ipythonコマンドが使えるならば
  (custom-set-variables '(py-shell-name "ipython")) ;; ipythonコマンドを使う
  (custom-set-variables '(py-force-py-shell-name-p t)) ;; ipythonコマンドを強制する
  (custom-set-variables '(py-ipython-command-args "--simple-prompt -i")) ;; ipythonコマンドの引数を変える
  )

PR