Notebook: print colors in a notebook cell's output

Created on 14 Mar 2017  路  6Comments  路  Source: jupyter/notebook

Googling about it, it appears like the notebook should support ANSI colors, but I cannot get it to work.
I just want to print colored statements from within my functions.

2017-03-14_15-24-40

Any idea what's wrong? The problem persists after disabling all nbextensions.

Most helpful comment

screenshot from 2017-03-14 15-39-36

Don't use colorama.init(). Colorama is intended to turn the ANSI colour codes into Windows console API calls, but it will detect that you're not in a Windows console and strip the ANSI codes out entirely, so the notebook doesn't see them.

All 6 comments

screenshot from 2017-03-14 15-39-36

Don't use colorama.init(). Colorama is intended to turn the ANSI colour codes into Windows console API calls, but it will detect that you're not in a Windows console and strip the ANSI codes out entirely, so the notebook doesn't see them.

Great, thank you @takluyver !

Not working.
ipython==6.4.0
ipython-genutils==0.2.0

Importing tqdm affects the colors if anyone still using that thing.

@krishnachouhan why is that?

Not sure @jolespin.
Here is the opened issue..
https://github .com/tqdm/tqdm/ issues /678

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmesro picture cmesro  路  3Comments

mowe96 picture mowe96  路  3Comments

qnicole-zakka picture qnicole-zakka  路  3Comments

jonatanblue picture jonatanblue  路  3Comments

Foadsf picture Foadsf  路  3Comments