[IPython-user] IPython under ntemacs -- step by step?
DaveS
davls@telus....
Tue Feb 27 23:19:36 CST 2007
On Tue, Feb 27 2007, Mike Krell wrote:
> Hi,
>
> I know there were some recent messages here regarding getting ipython
> to run under gnu emacs for windows (ntemacs). I'd really love to do
> this.
>
> Can someone fill me in on how well this works and exactly what
> versions of ipython, ntemacs, and python-mode.el (or python.el) I need
> to get this running? Step by step instructions would be the ideal,
> but I suspect they're not available.
>
> I searched for this on the ipython wiki with no luck. If someone
> could give me a pointer, I'll be glad to write up more detailed
> instructions and post them on the wiki.
>
> Thanks,
> Mike
You don't specify how far you've managed to get so I'll assume not very.
I'm using
* WinXPsp2
* emacs 21.3.1
* python2.5
* ipython 0.7.3
* python-mode.el 4.79
I had to created a file "ipython.cmd" in the python scripts directory to get
emacs to interact properly with ipython.
--8<---------------cut here---------------start------------->8---
@C:\Python25\python.exe -i "C:\Python25\Scripts\ipython"
--8<---------------cut here---------------end--------------->8---
1. make sure ipython works from the cmd shell.
2. edit your .emacs to load ipython
--8<---------------cut here---------------start------------->8---
(eval-after-load "python-mode"
'(progn
(setq ipython-command "c:/python25/scripts/ipython")
(require 'ipython)
))
--8<---------------cut here---------------end--------------->8---
3. load "python-mode" and start a py-shell. You should get an ipython prompt.
4. if you see "^A^B" junk in the output (I did) add the following to your
.emacs file to clean it up.
--8<---------------cut here---------------start------------->8---
(defun my-strip-ctrl-a-ctrl-b (string)
"Remove `^A' and `^B' characters from STRING.
These characters may show up in some shell output. This function can be placed
on `comint-preoutput-filter-functions'."
(replace-in-string string "[\C-a\C-b]" ""))
(defun my-py-shell-hook ()
;; ipython in NT emacs has display problems, this cleans the output.
(add-hook 'comint-preoutput-filter-functions 'my-strip-ctrl-a-ctrl-b))
(add-hook 'py-shell-hook 'my-py-shell-hook)
--8<---------------cut here---------------end--------------->8---
I have other stuff to customize the display, but this is basically all I did
to get it working. (I've made a lot of changes, so I may be forgetting
something, but hopefully not)
Getting the fancy pdb tracking stuff working is a bit more difficult, but I
can give you the details afterwards if you want.
--
DS
More information about the IPython-user
mailing list