zoukankan      html  css  js  c++  java
  • print显示颜色

    显示颜色格式:33[显示方式;字体色;背景色m......[33[0m]

     
    1. -------------------------------------------
    2. -------------------------------------------
    3. 字体色     |       背景色     |      颜色描述
    4. -------------------------------------------
    5. 30        |        40       |       黑色
    6. 31        |        41       |       红色
    7. 32        |        42       |       绿色
    8. 33        |        43       |       黃色
    9. 34        |        44       |       蓝色
    10. 35        |        45       |       紫红色
    11. 36        |        46       |       青蓝色
    12. 37        |        47       |       白色
    13. -------------------------------------------
    14. -------------------------------
    15. 显示方式     |      效果
    16. -------------------------------
    17. 0           |     终端默认设置
    18. 1           |     高亮显示
    19. 4           |     使用下划线
    20. 5           |     闪烁
    21. 7           |     反白显示
    22. 8           |     不可见
    23. -------------------------------
    例:
    1. print('This is a 33[1;35m test 33[0m!')print('This is a 33[1;32;43m test 33[0m!')print('33[1;33;44mThis is a test !33[0m')
    输出结果:
     

    print输出时不换行:

    1. 如果 python2.x版本,在语句后加一个英文的逗号 ,
    2. print x,
    3. 如果 python3.x 版本 print不换行参数 end=""
    4. print(x, end="")
    例:
    1. print('he'
    2.       ''   #中间回车键换行
    3.       ''
    4.       ''
    5.       'llo',end='')
    输出结果:
    1. hello

  • 相关阅读:
    mysql 远程登陆不上
    hdu 5339 Untitled【搜索】
    SqlServer 书目
    passwordauthentication yes
    oracle 11g RAC ocfs2
    Oracle 11g RAC database on ASM, ACFS or OCFS2
    CentOS ips bonding
    Oracle 11g RAC features
    openStack 王者归来之 trivial matters
    openstack windows 2008 img
  • 原文地址:https://www.cnblogs.com/Javauser/p/8950442.html
Copyright © 2011-2022 走看看