Advertisement
aveBHS

Color text

Feb 27th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. from colorama import init, Fore
  2.  
  3. colors = {
  4.     'white': Fore.WHITE,
  5.     'green': Fore.GREEN,
  6.     'red': Fore.RED,
  7.     'yellow': Fore.YELLOW
  8. }
  9.  
  10. def print_color(text, color):
  11.     print(colors[color.lower()])
  12.     print(text)
  13.     print(colors['white'])
  14.  
  15. print_color('Example', 'green')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement