推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Kai
1.51D
1.92D
V2EX  ›  Python

termcolor

  •  
  •   Kai · Feb 13, 2015 · 2821 views
    This topic created in 4150 days ago, the information mentioned may be changed or developed.
    from termcolor import colored
    
    print colored('Hello', 'blue') + ", " + colored('V2EX', 'cyan', attrs=['bold'])
    

    https://pypi.python.org/pypi/termcolor

    4 replies    2015-02-24 20:39:10 +08:00
    caizixian
        1
    caizixian  
       Feb 14, 2015
    还在想着怎么解决呢,就看到这个库了。
    多谢分享
    AnyOfYou
        2
    AnyOfYou  
       Feb 15, 2015   ❤️ 1
    刚好了解一点这个。如果想了解更多,或者需要定制更多的颜色,可以看看这里 http://en.wikipedia.org/wiki/ANSI_escape_code#Codes
    实际上使用30–37,40–47可以指定8种颜色,也可以用38;5;(0..255)来指定更多的颜色。
    jamiesun
        3
    jamiesun  
       Feb 24, 2015
    我这几天也折腾呢,自己用原始方法搞了一个,但是windows下不行
    https://gist.github.com/f057e65c482889d08331.git
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1204 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:38 · PVG 07:38 · LAX 16:38 · JFK 19:38
    ♥ Do have faith in what you're doing.