Python Forum
Adding colour to Python console
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding colour to Python console
#1
Hello guys,

I tried to colourise the texts in a Python consol applications but the results were a little bit weird.

Firstly, I googled the whole thing and I discovered the ANSI codes. For example, take a look at the following code.

print("\033[0;37;40m Normal text\n")
print("\033[2;37;40m Underlined text\033[0;37;40m \n")
print("\033[1;37;40m Bright Colour\033[0;37;40m \n")
print("\033[3;37;40m Negative Colour\033[0;37;40m \n")
print("\033[5;37;40m Negative Colour\033[0;37;40m\n")
This code is not part of my project, just to let you know what I did. I utlised these stuff in my code but the console remained with black background and white (or light grey) font colour. The funny thing is that in the Jupyter window the ANSI colour codes did work.
Reply


Messages In This Thread
Adding colour to Python console - by Archangelos - Apr-10-2020, 12:57 PM
RE: Adding colour to Python console - by buran - Apr-10-2020, 01:07 PM
RE: Adding colour to Python console - by buran - Apr-10-2020, 02:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  In Console,Python anna17 0 214 Mar-23-2024, 08:24 PM
Last Post: anna17
  Python Flask Realtime system printout (console) ffmpeg jttolleson 3 2,958 Apr-18-2022, 06:39 PM
Last Post: jttolleson
Question convert autohotkey script to python / macro - press key when pixel get colour willson94d 1 3,675 Jan-01-2022, 08:13 PM
Last Post: Yoriz
  Python library for win32 console commands eldiener 3 3,491 Aug-24-2021, 10:28 PM
Last Post: bowlofred
  Problem: Restart kernel onPydev console when trying to install a python package poppy2020 1 7,728 Nov-25-2020, 06:13 PM
Last Post: Larz60+
  to call via console a python-programm Liki 9 3,268 Nov-22-2020, 01:10 AM
Last Post: bowlofred
  My Python Console doesn´t work ModuleNotFoundError: No module named 'tokenize' RuanKishibe 1 3,145 Aug-06-2020, 10:07 PM
Last Post: deanhystad
  how to get some values from js on python console by python code vivekagrey 1 1,893 Feb-13-2020, 09:26 PM
Last Post: micseydel
  I don't know what's wrong with this code [Python Console] H0M1C1D4L_P1G 6 3,237 Dec-22-2019, 10:27 PM
Last Post: snippsat
  Adding markers to Folium map only adding last element. tantony 0 2,136 Oct-16-2019, 03:28 PM
Last Post: tantony

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020