Advertisement
python_notes

Add colored text to python code

Dec 12th, 2014
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. # Add color to text in python code using the "clint" module
  2.  
  3. # Github: https://github.com/kennethreitz/clint or just do sudo pip intall clint
  4.  
  5.  
  6.  
  7. Add this line to the top of your code to import clint
  8.  
  9. from clint.textui import colored
  10.  
  11.  
  12. Example usage:
  13.  
  14.  
  15. print colored.red('some warning message')
  16.  
  17. print colored.green('nicely done!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement