textwrap模块

fill  将多行文本按照指定的宽度和格式输出

s = "Look into my eyes, look into my eyes, the eyes, the eyes, \
the eyes, not around the eyes, don't look around the eyes, \
look into my eyes, you're under."

import textwrap
print(textwrap.fill(s, 70))
print(textwrap.fill(s, 40, initial_indent='    ', subsequent_indent='    '))

 

posted @   择一事,终一生  阅读(106)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示