码迷,mamicode.com
首页 > 其他好文 > 详细

指定段落宽度

时间:2018-11-22 18:14:56      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:port   one   sep   指定   pre   cep   display   style   app   

 

import textwrap
doc = """The wrap() method is just like fill() except that it returns
a list of strings instead of one big string with newlines to separate
 the wrapped lines."""
print(textwrap.fill(doc, width=40))

输出

The wrap() method is just like fill()
except that it returns a list of strings
instead of one big string with newlines
to separate  the wrapped lines.

 

指定段落宽度

标签:port   one   sep   指定   pre   cep   display   style   app   

原文地址:https://www.cnblogs.com/sea-stream/p/10002427.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!