New to both Python and StackOverflow, I\'d like a little help. I\'d like to print color in Python and have Googled but with little luck :( I\'ve been confused each time and
If you're using a terminal and/or shell that support ANSI escape sequences, something like the following should work:
print("Blah blah \033[0;32mthis part will be green\033[00m blah blah.")
print("Blah blah \033[0;31mthis part will be red\033[00m blah blah.")
I can confirm that it does work in bash
on Linux. See the Wikipedia page on ANSI escape codes for further details, including a comprehensive table describing the effects of different character sequences/values. I don't advocate this as a canonical solution, but it may be sufficient for your purposes.