what does 40click option do python

Solutions on MaxInterview for what does 40click option do python by the best coders in the world

showing results for - "what does 40click option do python"
Manuel
02 Jul 2020
1# It supplies options to be use in a command line interface. 
2# Much like the --help option that you see.
3# With this you can create your own options like count and name.
4# ex.
5import click
6
7@click.command()
8@click.option('--count', default=1, help='Number of greetings.')
9@click.option('--name', default='John,
10              help='The person to greet.')
11def hello(count, name):
12    """Simple program that greets NAME for a total of COUNT times."""
13    for x in range(count):
14        click.echo('Hello %s!' % name)
15
16if __name__ == '__main__':
17    hello()
18    
19# output
20$ python hello.py --count=3
21
22Hello John!