Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gmolveau
GitHub Repository: gmolveau/python_full_course
Path: blob/master/examples/cli/click_simple.py
305 views
1
import click
2
3
4
@click.command()
5
@click.option("--count", default=1, help="Number of greetings.")
6
@click.option("--name", required=True, help="The person to greet.")
7
def hello(count, name):
8
"""Simple program that greets NAME for a total of COUNT times."""
9
for x in range(count):
10
click.echo(f"Hello {name}!")
11
12
13
if __name__ == "__main__":
14
hello()
15
16