cli.py 文件源码

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

项目:notary 作者: sxn 项目源码 文件源码
def choose_license(licenses, author, year):
    click.echo("Found the following matching licenses:")
    click.echo(
        green(
            "\n".join(
                [
                    '{index}: {name}'.format(index=index + 1, name=lic.name)
                    for index, lic in enumerate(licenses)
                ]
            )
        )
    )
    choice = click.prompt(
        "Please choose which one you'd like to add",
        default=1,
        type=click.IntRange(1, len(licenses))
    )
    return licenses[choice - 1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号