Telegram Group & Telegram Channel
Задаем ширину текста

Ранее уже был пост про встроенный модуль textwrap — там мы рассказывали про то, как сократить текст до определенного количества символов без прерывания на середине слова.

Но мощные функции для красивого форматирования текста на этом не заканчиваются. В модуле есть еще fill, который позволяет задать ширину текста в символах.

Как видите в примере на картинке, слова переносятся на новые строки и ничего не обрывается на полуслове.

#textwrap



tg-me.com/python_academy/525
Create:
Last Update:

Задаем ширину текста

Ранее уже был пост про встроенный модуль textwrap — там мы рассказывали про то, как сократить текст до определенного количества символов без прерывания на середине слова.

Но мощные функции для красивого форматирования текста на этом не заканчиваются. В модуле есть еще fill, который позволяет задать ширину текста в символах.

Как видите в примере на картинке, слова переносятся на новые строки и ничего не обрывается на полуслове.

#textwrap

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/525

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

For some time, Mr. Durov and a few dozen staffers had no fixed headquarters, but rather traveled the world, setting up shop in one city after another, he told the Journal in 2016. The company now has its operational base in Dubai, though it says it doesn’t keep servers there.Mr. Durov maintains a yearslong friendship from his VK days with actor and tech investor Jared Leto, with whom he shares an ascetic lifestyle that eschews meat and alcohol.

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

Python Academy from tw


Telegram Python Academy
FROM USA