[Python] [Odlboy] Sets the color of the string print

Source: Internet
Author: User

Format: \033[display mode; foreground color; background colour m

Description
Foreground background color
---------------------------------------
30 40 Black
31 41 Red
32 42 Green
33 43 Yellow
34 44 Blue
35 45 Purplish red
36 46 Cyan Blue
37 47 White
Meaning of display mode
-------------------------
0 Terminal default settings
1 highlighting
4 using underscores
5 Flashing
7 Anti-white display
8 Not visible

Example:
\033[1;31;40m <!--1-highlight 31-foreground color Red 40-background black--
\033[0m <!--Use the terminal default setting, which cancels the color setting--

print ' \033[1;31;40m '
print ' * ' * 50
print ' *host:\t ', request. Meta.get (' REMOTE_ADDR ')
print ' *uri:\t ', Request.path
print ' *args:\t ', querydict (request.body)
print ' *time:\t ', Time.time ()-Request.start_time
print ' * ' * 50
print ' \033[0m '

[Python][odlboy] Sets the color of the string to print

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.