# Text color in python interactor

**URL:** <https://discourse.slicer.org/t/text-color-in-python-interactor/32422>\
**Category:** Development\
**Created:** [October 26, 2023, 8:15am UTC](https://discourse.slicer.org/t/text-color-in-python-interactor/32422 "2023-10-26T08:15:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [October 26, 2023, 8:15am UTC](https://discourse.slicer.org/t/text-color-in-python-interactor/32422/1 "2023-10-26T08:15:59Z")

</div>

Hi all,

How can I print text in the python interactor in different colors?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 26, 2023, 12:30pm UTC](https://discourse.slicer.org/t/text-color-in-python-interactor/32422/2 "2023-10-26T12:30:00Z")

</div>

Colors are reserved for distinguishing different types of messages (info, warning, error, console input/output). What would you like to achieve?

---

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [October 26, 2023, 2:18pm UTC](https://discourse.slicer.org/t/text-color-in-python-interactor/32422/3 "2023-10-26T14:18:09Z")

</div>

That’s exactly what I want. When running the code, I want to notify the user or print error messages, but I would like to do so in a different color.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [October 26, 2023, 2:32pm UTC](https://discourse.slicer.org/t/text-color-in-python-interactor/32422/4 "2023-10-26T14:32:50Z")

</div>

You can use

```auto
import logging
logging.info('All OK')
logging.warning('Something is wrong')
logging.error('Even worse')

```

---

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [October 27, 2023, 6:52am UTC](https://discourse.slicer.org/t/text-color-in-python-interactor/32422/5 "2023-10-27T06:52:26Z")

</div>

> [@cpinter](#):
>
> ```auto
> import logging
> logging.info('All OK')
> logging.warning('Something is wrong')
> logging.error('Even worse')
> 
> ```

Thanks. Still not working as expected:

![imagen](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/d/2ddcc11c13b1d8e72b60ccfe35c0a0f33ac93458.png)

So I guess that it is not possible to print text in a random color.
