[IPython-user] Hooking into the autocall displayer
Fernando Perez
fperez.net@gmail....
Mon Sep 17 11:39:39 CDT 2007
On 9/17/07, Tom Denniston <tom.denniston@alum.dartmouth.org> wrote:
> Thanks Fernando.
>
> It seems to work fine in a perhaps hacky way if I simply call it
> through the display hook:
>
> On linux it works great:
> In [7]: sys.displayhook.prompt1.write(sys.displayhook.prompt1.auto_rewrite()
> + 'mystring\n')
> ------> mystring
> Out[7]: ''
>
> Green arrow and everything!
>
> On windows however, the escape sequences do not get properly interpretted:
>
> In [27]: sys.displayhook.prompt1.write(sys.displayhook.prompt1.auto_rewrite() +
> 'MyString\n')
> ←[0;32m-------> ←[0mMyString
> Out[27]: ''
>
> Do I need to do something different on windows?
It's best to keep your replies on-list, so others can also help.
In particular, in this case I don't really know what the problem is on
Win32, since I know very little about the handling of color escapes on
that platform. I hope our resident win32 experts may be able to help.
Cheers,
f
More information about the IPython-user
mailing list