0

I am using a text function like this: text = "Text Here" in Python 3, and I was wondering how I could (or if it was even possible) to allow that text function to use color like in print.

Is this somehow possible?

  • `text = "Text Here"` is not a function, is a variable. – Lucas Jan 23 '17 at 00:33
  • I can't understand what you mean with: "to allow that text function to use color". Can you be clearer? – Lucas Jan 23 '17 at 00:36
  • Welcome to Stack Overflow! You can [take the tour](http://stackoverflow.com/tour) first and learn [How to Ask a good question](http://stackoverflow.com/help/how-to-ask) and create a [Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example. That makes it easier for us to help you. – Stephen Rauch Jan 23 '17 at 00:37
  • I mean, you can use color in print like this: ```from color import colored print (colored("Text Here", 'color')``` and that gives you whatever color you want. But I want it to work with texts. Would it? –  Jan 29 '17 at 02:52
  • Does this answer your question? [How to print colored text in Python?](https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-python) – Tomerikoo Dec 15 '20 at 15:54

1 Answers1

0

There are online sites that can give you the answer to this question. An example of text color in python would be print("\033[1;32;40m Bright Green \n"). The code for colors are: table

That is the table for the color codes. I hope this helps and that your question is answered! (:

Skyy Civil
  • 63
  • 8