filmov
tv
python text wrap with shorten function
Показать описание
In the preceding example, we used the shorten() function to truncate our text and
fit that text in a specified width. First, all the whitespaces truncated into the
single space. If the result fited in the specified width, the result was displayed on
the screen. If not, then the words of the specified width was displayed on the
screen and the rest was placed in the placeholder.
fit that text in a specified width. First, all the whitespaces truncated into the
single space. If the result fited in the specified width, the result was displayed on
the screen. If not, then the words of the specified width was displayed on the
screen and the rest was placed in the placeholder.