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]) + '`');  # 两个表格
        

    返回

  • 相关阅读:
    IOS10.8.2安装
    如何读本地资源图片
    SqlServer2000日志文件过大问题处理
    xcode 4.5.1 免证书开发 破解
    C#生成注册码
    去掉Html标签方法
    数组处理
    返回代码
    Javascript图像处理——图像金字塔
    Javascript图像处理——图像形态学
  • 原文地址:https://www.cnblogs.com/bitquant/p/7209776.html
Copyright © 2011-2022 走看看