exceptions.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:discord_chat_bot 作者: chromaticity 项目源码 文件源码
def _pretty_wrap(text, pretext, *, width=-1):
        if width is None:
            return pretext + text
        elif width == -1:
            width = shutil.get_terminal_size().columns

        l1, *lx = textwrap.wrap(text, width=width - 1 - len(pretext))

        lx = [((' ' * len(pretext)) + l).rstrip().ljust(width) for l in lx]
        l1 = (pretext + l1).ljust(width)

        return ''.join([l1, *lx])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号