Git Product home page Git Product logo

shcolor's Introduction

在linux和windows上打印彩色文字

安装

pip install bashcolor
python -m bashcolor
# 如果打印出所有支持的颜色 表示安装成功

使用

from bashcolor import *

COLORS      # 支持的所有颜色
BGCOLORS    # 支持的背景颜色
STYLES      # windows不支持此项

color.red('This is red text')
color.green('This is green text')

color类

color所支持的颜色 可以调用dir(color)获取到
color.red(msg, bgcolor, style)
msg: 自定义的文字
bgcolor: 背景颜色 可以传入BGCOLOR字典中的所有值
style: Linux可以传入STYLES字典中的所有值 Windows将忽略它

每个颜色 还有对应的light开头的方法 这个会高亮显示这个颜色

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.