[IPython-user] Fwd: Auto-discard notification

Fernando.Perez at colorado.edu Fernando.Perez at colorado.edu
Sun Apr 24 07:10:06 CDT 2005

Hi all,

I have very limited email access right now, so I'll just forward this blindly,
which was sent by a non-subscriber.

Hi Mike,

Please note that I don't know Python and its tools, so my comments are
just generic here.

Mike Krell writes:
> I've managed to get the python interpreter within emacs to display
> the IPython prompt instead of the normal Python prompt.  I did this
> by creating a file ipython.cmd containing
> "python -i Path\To\Python\scripts\ipython"
> and by setting emacs's ipython-command variable to "ipython".  This
> sort of works;

The problem here is (as maybe you know already) that Windows has no
concept of a pseudotty as is used on Unix.  Emacs has to run programs
in a pipe instead of in a tty-simulation.  Script interpreters see
that it's input is a pipe and assume it's just a redirection from the
command shell, so they don't display a prompt and they don't output
the result of operations automatically.

Work-arounds can be an option for the script interpreter executable to
work in interactive mode or a script that implements the interaction
prompt-command-result loop itself, like the ipython script seems to do

> I now get a prompt that looks like:
> ^A^BIn [^A^B1^A^B]: ^A^B
> where the ^A and ^B are control A and control B characters. The
> middle portion is light and dark green as expected.

You may want to try ansi-color-for-comint-mode to see if that can
interpret the controls characters.

> It's semi-responsive; typing "help" returns help, and tab completion
> works on keywords.  However, typing a syntax error returns nothing
> except the next command prompt.

Usually the command loop would catch errors and print them to stderr.
Depending on the conventions of your language, you also may need to
flush stderr/stdout before printing another prompt.  Does the ipython
script do that?

-------------- next part --------------
An embedded message was scrubbed...
From: unknown sender
Subject: no subject
Date: no date
Size: 4792
Url: http://projects.scipy.org/pipermail/ipython-user/attachments/20050424/5edee218/attachment.mht 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unnamed
Url: http://projects.scipy.org/pipermail/ipython-user/attachments/20050424/5edee218/attachment.pl 

More information about the IPython-user mailing list