zoukankan      html  css  js  c++  java
  • BotVS开发基础—2.5 状态信息显示表格

    代码

    import json
    def main():
        #part 1
        bol     = True
        num     = 10;           # 
        str     = "ABC";        # 字符串
        list    = [1, 2, 3, 4, 5];                          # 列表,方括号
        tuple   = ('physics', 'chemistry', 1997, 2000);     # 元组,小括号,内容不可修改!
        dict    = {'name': "tom", 'age': 14};               #字典
        
        Log(type(bol));
        Log(type(num));
        Log(type(str));
        Log(type(list));
        Log(type(tuple));
        Log(type(dict));
        LogStatus("状态栏显示文本!
     第二行文本 
    ", num, str, list, tuple, dict);   # 在状态栏里面把以上变量当做参数传入。
        #part 2
        table = {
          'type': 'table',          # 类型。
          'title': '持仓信息',      # 表格标题
          'cols': ['列1', '列2'],   # 表格表头
          'rows': [                 # 表格单元格
                    ['abc', 'def'], 
                    ['ABC', 'support color #ff0000']
                  ]   
                };
        LogStatus('`' + json.dumps(table) + '`');  # table 序列化,前后再加字符`。 
      
        #part 3
        table2 = {                  # 第二个表格
            'type': 'table',
            'title': '第二个表格',
            'cols': ['cols1', 'cols2', 'cols3'],
            'rows': [ ['1', '2', '3'], ['A', "B#FF5634", 'C'], ['', '', '']]
        };
        LogStatus('`' + json.dumps([table, table2]) + '`');  # 两个表格
        

    返回

  • 相关阅读:
    60、剑指offer--把二叉树打印成多行
    59、剑指offer--按之字形顺序打印二叉树
    KNN(最近邻算法)
    RBM(受限玻尔兹曼机)
    Denoising Autoencod
    决策树算法
    AdaBoost算法简介
    suricata工作流程简介
    KD tree详解
    tesseract训练新字库
  • 原文地址:https://www.cnblogs.com/bitquant/p/7209776.html
Copyright © 2011-2022 走看看