rhama

Python Colorize

Dec 29th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. RED = '\033[31m'
  4. RESET = '\033[0;0m'
  5. BLINK = '\033[05m'
  6. NOBLINK = '\033[25m'
  7. txtblk='\e[0;30m' # Black - Regular
  8. txtred='\e[0;31m' # Red
  9. txtgrn='\e[0;32m' # Green
  10. txtylw='\e[0;33m' # Yellow
  11. txtblu='\e[0;34m' # Blue
  12. txtpur='\e[0;35m' # Purple
  13. txtcyn='\e[0;36m' # Cyan
  14. txtwht='\e[0;37m' # White
  15. bldblk='\e[1;30m' # Black - Bold
  16. bldred='\e[1;31m' # Red
  17. bldgrn='\e[1;32m' # Green
  18. bldylw='\e[1;33m' # Yellow
  19. bldblu='\e[1;34m' # Blue
  20. bldpur='\e[1;35m' # Purple
  21. bldcyn='\e[1;36m' # Cyan
  22. bldwht='\e[1;37m' # White
  23. unkblk='\e[4;30m' # Black - Underline
  24. undred='\e[4;31m' # Red
  25. undgrn='\e[4;32m' # Green
  26. undylw='\e[4;33m' # Yellow
  27. undblu='\e[4;34m' # Blue
  28. undpur='\e[4;35m' # Purple
  29. undcyn='\e[4;36m' # Cyan
  30. undwht='\e[4;37m' # White
  31. bakblk='\e[40m'   # Black - Background
  32. bakred='\e[41m'   # Red
  33. badgrn='\e[42m'   # Green
  34. bakylw='\e[43m'   # Yellow
  35. bakblu='\e[44m'   # Blue
  36. bakpur='\e[45m'   # Purple
  37. bakcyn='\e[46m'   # Cyan
  38. bakwht='\e[47m'   # White
  39. txtrst='\e[0m'    # Text Reset
  40.  
  41. print RED+"DANGER, you will see the red text !!"+RESET
  42. print "Dont worry this is just normal text"
  43. print "This is will \""+BLINK+"blinking you\'re eyes !"+NOBLINK+"\" but don't worry we'll be back normal ;)"
  44. print RED+"gunslinger_"+RESET
Advertisement
Add Comment
Please, Sign In to add comment