'jupyter notebook not formatting text colour when calling print('\033[92m' + str)

The following line

print('\033[92m' + "Hello")

should change the font colour to green and print Hello and that's what happens when running the line in the terminal.

However, that's not what happens in the jupyter notebook: it prints Hello but without changing the colour: how can I make it work on jupyter notebook as well?

I am on Ubuntu and I ran the notebook from the Terminal. My jupyter notebook version is 6.0.3.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source