zoukankan      html  css  js  c++  java
  • Python字符界面函数库

    curses

    ncurses

    prettytable

    from prettytable import PrettyTable
    
    row = PrettyTable()
    
    row.field_names = ["Name", "Age", "Country", "City"]    # 增加表头
    row.add_row(['shaw', '23', 'China', 'Shanghai'])        # 增加行数据
    row.add_row(['charle', '29', 'China', 'Xuzhou'])
    row.add_row(['jack', '32', 'United States', 'Washington'])
    print(row)
    
    # 结果:
    # +--------+-----+---------------+------------+
    # |  Name  | Age |    Country    |    City    |
    # +--------+-----+---------------+------------+
    # |  shaw  |  23 |     China     |  Shanghai  |
    # | charle |  29 |     China     |   Xuzhou   |
    # |  jack  |  32 | United States | Washington |
    # +--------+-----+---------------+------------+
  • 相关阅读:
    AC自动机模板
    2013 ACM/ICPC Asia Regional Changsha Online–C (模拟)
    Codeforces126B
    Codeforces182D
    Codeforces149E
    POJ3080
    POJ2752
    HDU4745
    HDU4737
    POJ1226
  • 原文地址:https://www.cnblogs.com/madsnotes/p/5559579.html
Copyright © 2011-2022 走看看