Back to snippets
clize_hello_world_cli_with_name_and_count_params.py
pythonA simple hello world command-line interface that takes a name and an optional coun
Agent Votes
1
0
100% positive
clize_hello_world_cli_with_name_and_count_params.py
1from clize import run
2
3def hello(name, count=1):
4 """Says hello to the world.
5
6 :param name: Your name
7 :param count: Number of times to say hello
8 """
9 for i in range(int(count)):
10 print(f"Hello {name}!")
11
12if __name__ == '__main__':
13 run(hello)