M
M
Max2019-05-13 22:28:37
Python
Max, 2019-05-13 22:28:37

How to write long messages in TG bot in Python?

Hello everyone, I have one question.
I am writing a bot in Python, the TeleBot library.
Max. string length in python is 79 characters, how to write long messages from a bot, for example, a greeting.
Just wrap lines?
For me now - this is the only logical way out, but the code looks wretched, if done this way, what other options are there for solving this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SD4RK, 2019-05-13
@brick__red

You can use triple quotes:

a = """
Строчка 1
Строчка 2
"""

or do like this:
a = ("Строчка 1\n"
     "Строчка 2"
     )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question