Python click使用

2020-07-17  本文已影响0人  圈圈55

import click

@click.command()

@click.option('--count', default=1, help='Number of greetings.')

@click.option('--name', prompt='Your name',

              help='The person to greet.')

def hello(count, name):

    """Simple program that greets NAME for a total of COUNT times."""

    for x in range(count):

        click.echo('Hello %s!' % name)

if __name__ == '__main__':

    hello()

上一篇 下一篇

猜你喜欢

热点阅读