[IPython-dev] IPython with Color on windows

Gary Bishop gb at cs.unc.edu
Sat May 24 07:20:14 EDT 2003


On Fri, 23 May 2003 19:56:56 -0600 "Fernando Perez" 
<fperez at colorado.edu> wrote:
> Ipython prints all output via the Prompts classes.  Take a look at that 
> file, it's fairly simple.  It uses the fact that python itself honors 
> whatever is hooked into sys.displayhook:

The appears to only apply to prompts 'In[0]' and results from 
computations. If I look at ultraTB.py I see

    def __call__(self, etype, value, elist):
        print >> sys.stderr, self.text(etype,value,elist)

greping for 'print' is see many but few that involve color so most are OK.

PyColorize.py appears to write to stdout.

Does stdout get mapped into some file-like object that sends text 
through code in Prompts?

I can already handle color in prompts because they come to readline for 
printing. But if I'm going to make color work for tracebacks, or 
listings, or other places, I'll have to have access to the strings 
before they go out.

Likely I'm missing something.

Thanks for your help,
gb



More information about the IPython-dev mailing list