Type/to search
6
Follow
16
Followers
ヘルプ
Help
Created 2017-06-07 09:42:08  Updated 2017-06-07 09:42:37
 1
 1947

PythonでAPIドキュメントのコードをテストする初心者,エラーが発生し,助けを求めます.

import matplotlib.pyplot as plt
import json
def main():
plt.plot([3,6,2,4,7,1])
LogStatus(plt)
table = {type: 'table', title: '倉庫情報', cols: 固定リンク[[ 列1 列2 ][ ['abc', 'def'], ['ABC', 'support color #ff0000']]}
LogStatus('`' + JSON.stringify(table)+'`# JSON シリアル化後に両側に加える`字符, 视为一个复杂消息格式(当前支持表格) LogStatus('第一行消息\n`' + JSON.stringify(table)+'`\n第三行消息') # 表格信息也可以在多行中出现 LogStatus('`' + JSON.stringify([table, table])+'`') # は,複数の表を同時に表示し,TABでグループに表示します.

Related Recommendations
Comment
All comments (1)

    img
    第一眼看到 代码,发现 问题应该是 你写的时候 单引号 ' 使用 中文输入了 ‘ , 这两个字符是不一样的,所以初学者需要注意的是 编程的时候一定 是 英文状态的输入法。
    并且在代码编辑框可以提前看出来, 出现这样的红色的字符 颜色提示 一般都是很明显的错误。

    代码中还有几处错误
    正确的代码:

    import matplotlib.pyplot as plt import json def main(): plt.plot([3,6,2,4,7,1]) LogStatus(plt) table = {"type" : 'table', "title": '持仓信息', "cols": ['列1', '列2'], "rows": [ ['abc', 'def'], ['ABC', 'support color #ff0000']]} LogStatus('`' + json.dumps(table) + '`') # JSON序列化后两边加上字符, 视为一个复杂消息格式(当前支持表格) LogStatus('第一行消息\n‘ + JSON.stringify(table)+’\n第三行消息') # 表格信息也可以在多行中出现 LogStatus('‘ + JSON.stringify([table, table])+’`’) # 支持多个表格同时显示, 将以TAB显示到一组里

    可以对比下 找找不同!
    运行回测:
    img
    显示为表格,之前的 折线图就不显示了。

    9 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)