Python: format string as table in non-monospace font -


i'm working on slack webhooks integration slack slash commands. script flow following:

  1. getting slash command request slack.
  2. processing data (in form of dict or pandas dataframe)
  3. posting channel using slack webhook.

my response set of key:value records or 2 columns dataframe. want print them nicely slack, ran formatting problem.

  1. using slack back-ticks make code block monospace font not work, because might have large records, , slack trims string after 8000 characters.

  2. printing lines without monospace, plain text, results in ugly columns different width in each row.

i tried sorts of formatting tricks, not find way format response using slack api 2 long columns. guess looking library format string me given font being used.

any appreciated.

slack messages not designed handle large sets of structured data sets. in personal opinion best option provide link webpage showing data.

however,if want show data within slack recommend upload plain text file. can larger 8.000 chars , can displayed monospaced font, allow format them properly.

check out files.upload filetype set text upload , share file in channel.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -