string formatting appears differently on different environment

Viewed 37

I'm trying to send text from python to slack by using slackbotAPI. I processed text like this: (looks neat) enter image description here

I formatted string by this code line: enter image description here

But after sending this text by slackbot API, text appeared on slack like this: enter image description here

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.

1 Answers

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

Screenshot of a slack message with fields

Related