字符串格式在不同的环境中出现不同
我正在尝试通过使用SlackBotapi将短信从Python发送到Slack。 我处理了这样的文字:(看起来很整洁)
但是在Slackbot API发送此文本后,文本出现在Slack上:
我猜每个字符的宽度(包括空间)在松弛上有所不同,但在python提示中没有不同。 我如何能像python上的懈怠一样整洁地看到文字? 谢谢。
I'm trying to send text from python to slack by using slackbotAPI.
I processed text like this: (looks neat)
I formatted string by this code line:
But after sending this text by slackbot API, text appeared on slack like this:
I guess the width of each character(include space)is different on slack, but not on python prompt.
How can I see the text neatly on slack like on python?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为,实现您想要的最佳方法不是使用Tabs等文本字符,而是使用段块内部的字段。
这将确保不管接口如何,它们都可以正确排列。
这是一个示例
I think the best way to achieve what you're looking for isn't with text characters like tabs etc, but to use fields inside a section block.
That will make sure that regardless of interface, they're arranged correctly.
Here's an example