Skip to content

Instantly share code, notes, and snippets.

@qqpann
Created September 18, 2018 14:25
Show Gist options
  • Save qqpann/d4927785cd94f1e7ec9e791bb4324ba3 to your computer and use it in GitHub Desktop.
Save qqpann/d4927785cd94f1e7ec9e791bb4324ba3 to your computer and use it in GitHub Desktop.
[Python Click ~ cli library] Python cli library: Click #python #click #cli
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