0

I have a python file names test.py which containes python code.

print "THIS IS TEST"
print "THIS IS GOOD"
print "THIS IS BAD"

I want to change the font\color or background of the line in any editor

print "THIS IS GOOD"

How can I do that?

If its editors specific, which editor will allow me to do such changes in file itself using code? IDLE, Eclipse, Notepad++ or any else?

Please let me know any editor and its scripting example by which I can view such changed file with changed line in it.

I DO NOT WISH TO PRINT IN TERMINAL. I NEED TO HIGHLIGHT LINE/CHANGE FONT IN ECLIPSE, NOTEPAD++ OR IDLE.

sam
  • 18,509
  • 24
  • 83
  • 116

1 Answers1

1

Print in terminal with colors using Python?

This question will help.

An example:

print '\033[94m'+"THIS IS GOOD"+'\033[0m'

Since you referenced "notepad++", I guess you work on windows. So, try this:

Change shell print color in python 3.3.2

from subprocess import call

call('color a', shell=True) #this sets the color to light green
print('The quick brown fox jumps over the lazy dog.')
Community
  • 1
  • 1
PaleNeutron
  • 2,543
  • 4
  • 25
  • 43
  • I want color should be change in notepadd++ and not shell. I need to change color\font for viewing purpose in editor. – sam Oct 09 '14 at 04:33