首页 > 其他 > 详细

指定段落宽度

时间:2018-11-22 17:54:33      阅读:138      评论:0      收藏:0      [点我收藏+]

 

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.

 

指定段落宽度

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!