0

I am using discord.py and I need the bot to send a multi-line message. This is easy to do, but sending each line separately is a pain and it isn't very quick. So I thought, why not have it send the whole shebang at once?

All I need is to somehow take everything inside of the terminal and set that as a variable that I can later send as a single message.

Here's the entire terminal output:

Here's the entire terminal output

bad_coder
  • 11,289
  • 20
  • 44
  • 72
thehammerons
  • 55
  • 1
  • 5

1 Answers1

1

It looks like your data is roughly tabular - why not write to csv or json and send it that way?

Alternatively, f-strings in python preserve formatting, and can be multiple lines, although I don't think that's recommended by PEP8.

EDIT Here is a somewhat related question that covers multi-line strings: Multiline f-string in Python

trish_s
  • 130
  • 7