Created
September 18, 2018 14:25
-
-
Save qqpann/d4927785cd94f1e7ec9e791bb4324ba3 to your computer and use it in GitHub Desktop.
[Python Click ~ cli library] Python cli library: Click #python #click #cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment