本文整理汇总了Python中table.Table.header_row方法的典型用法代码示例。如果您正苦于以下问题:Python Table.header_row方法的具体用法?Python Table.header_row怎么用?Python Table.header_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table.Table
的用法示例。
在下文中一共展示了Table.header_row方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import header_row [as 别名]
def main():
# Load command-line arguments
args = setup_argparser()
# Setup Tables for storing data
NAME_COL_WIDTH = 20
new_data_table = Table(col_width=[5,NAME_COL_WIDTH,6,3] + [6,6] + [6,6,6,6] + [10, 6],
data_format=["{:d}","{:s}","{:d}","{}","{:.1f}","{:.1f}","{}","{:.1f}","{}","{:.1f}","{:.1%}", "{:.1f}"],
col_sep=1)
# Create two-row header
new_data_table.header_row([(4, ""), (2, "POWER (W)", "-"), (4, "SAMPLE PERIOD (s)", "-"), (2, "")])
new_data_table.header_row(["#",
"name",
"count",
"s",
"min", "max",
"min", "mean", "max", "stdev",
"% missed",
"kwh"
])
if args.use_cache:
cache_table = Table(col_width=[5,NAME_COL_WIDTH,6] + [6,6] + [6,6,6] + [10, 6],
data_format=["{:d}","{:s}","{:d}","{:.1f}","{:.1f}","{}","{:.1f}","{}","{:.1%}", "{:.1f}"])
cache_table.header_row([(3, ""), (2, "POWER (W)", "-"), (3, "SAMPLE PERIOD (s)", "-"), (2, "")])
cache_table.header_row(["#",
"name",
"count",
"min", "max",
"min", "mean", "max",
"% missed",
"kwh"
])
totals_table = copy.deepcopy(cache_table)
data_available = False
input_tz = pytz.timezone(args.input_timezone)
# Load labels.dat
try:
labels = load_labels(args)
except IOError, e:
sys.exit(e)