我有一个变量:
row='saint george 1739 1799 violin concerti g 029 039 050 symphonie concertante for two violins g 024 bertrand cervera in 024 039 christophe guiot in 024 029 and thibault vieux violin soloists orchestre les archets de paris'
我这样做:
^{pr2}$我想要一些列表line
有line[0]='saint george 1739 1799 violin concerti g 029 039 050'
和{
请帮助我将文本包装转换为列表
请注意,textwrap通过\n
来分解内容
你可以使用例如^{} 它
或者使用
textwrap.wrap
。在使用
textwrap.wrap
代替textwrap.fill
^{} 返回一个列表。为什么不用这个?在
textwrap.fill(text, ...)
相当于"\n".join(wrap(text, ...))
。如docs中所述。在相关问题 更多 >
编程相关推荐