print
returns None
, and by returning it, your wrap
function would also return None
. It seems like you want to join i
with a newline:
def wrap(string, max_width):
i = textwrap.wrap(string, width=max_width)
return '
'.join(i)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…