Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Challenge] Colours
#2
Well in python there is a module called termcolor That allows you to do this. It is has a very simple function that takes two arguments, the string and the desired colour. Besides it's other functions, it lets you print in grey, red, green, yellow, blue, magenta, cyan, white.
Here is my script.
Code:
from termcolor import *

print colored('Hello World\n', 'green')
print colored('Hello World\n', 'red')
print colored('Hello World\n', 'cyan')
print colored('Hello World\n', 'magenta')
Of course this varies for different operating systems, to know if yours will print coloured text click the link above.
[Image: izsyo6.jpg]


Reply


Messages In This Thread
[Challenge] Colours - by Wolskie - 02-23-2010, 10:00 PM
RE: [Challenge] Colours - by uber1337 - 02-24-2010, 12:52 PM
RE: [Challenge] Colours - by Wolskie - 02-25-2010, 02:06 AM
RE: [Challenge] Colours - by uber1337 - 02-25-2010, 02:35 PM
RE: [Challenge] Colours - by Wolskie - 02-25-2010, 05:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Challenge] Random Wolskie 9 2,067 02-26-2010, 09:03 PM
Last Post: Canoris

Forum Jump:


Users browsing this thread: 1 Guest(s)