[IPython-User] IPython ColorANSI / genutils: now coloransi ???

Peter Teuben teuben@astro.umd....
Fri Oct 18 15:21:40 CDT 2013


I'm trying to install some (old?) python scripts that use ColorANSI and
genutils
from the IPython module.  They exist on scientific linux 6.4, (ipython
0.10) but not on
ubuntu 13.04 (ipython 0.13.2). I guess something changed.....

Not having much luck on google, I came up with the following solution,
which appears
to work for me.  Hope this to be useful for somebody running in the same
problem.
Of course I'm happy to hear comments , especially if there's a better way
(the Term module wasn't used in this code so I didn't have to check that)

try:
    # old code
    from IPython import ColorANSI
    from  IPython.genutils import Term
    tc = ColorANSI.TermColors()
except:
    # new code
    from IPython.utils import coloransi
    tc = coloransi.TermColors()



peter



More information about the IPython-User mailing list