viento_utils.py 文件源码

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

项目:viento 作者: tgsachse 项目源码 文件源码
def print_restricted(strings, template, spacing, color=None):
    """
    Prints a list of strings spaced out on the screen according to an
    accompanying template list. Output can be colored via cprint and the color
    variable.
    """
    string_list = []
    for each in zip(strings, template, spacing):
        segment = each[1].format(each[0][:each[2]], width=each[2])
        string_list.append(segment)

    for each in string_list:
        if color == None:
            print(each, end='')
        else:
            cprint(each, color, end='')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号