Add Click examples

This commit is contained in:
allegroai 2021-08-04 11:30:32 +03:00
parent 9a38682f9f
commit d83f1cd2c1
3 changed files with 6 additions and 3 deletions

View File

@ -14,7 +14,7 @@ def cli():
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(count):
click.echo(f"Hello {name}!")
click.echo("Hello {}!".format(name))
print('done')
@ -27,7 +27,7 @@ CONTEXT_SETTINGS = dict(
@click.option('--port', default=8000)
@click.option('--name', help='service name')
def runserver(port, name):
click.echo(f"Serving on http://127.0.0.1:{port} {name}/")
click.echo("Serving on http://127.0.0.1:{} {}/".format(port, name))
if __name__ == '__main__':

View File

@ -11,7 +11,7 @@ def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(count):
click.echo(f"Hello {name}!")
click.echo("Hello {}!".format(name))
if __name__ == '__main__':

View File

@ -0,0 +1,3 @@
click>=8.0
clearml