0

我正在基于 python 代码制作一个 Disord 机器人。python代码执行完美。但是当不和谐机器人调用程序时,它会破坏输出的格式/对齐方式。

我在 python 上使用表格作为输出。感谢您为解决这个问题所做的任何帮助。

这是调用列表以进行输出的制表代码

topgn=(tabulate(alist, headers='keys',tablefmt='pipe',numalign='left',stralign='center'))

还附上了屏幕截图python output ss - discord bot ss

万分感谢

4

1 回答 1

0

使用等宽字体。Discord 对此有代码块,需要 3 个反引号。所以你的代码是:

topgn = "```" + tabulate(alist, headers='keys',tablefmt='pipe',numalign='left',stralign='center') + "```"
于 2021-05-12T18:24:07.613 回答