Skip to content
Myr

README.md

This file

Path

README.md

52 lines · 1.3 KiB · Markdown

Last changed by

Merge branch '8.1.x'David Lordbefore adoption73cfe12

History of this file

Take it

Merge branch '8.1.x'David Lordbefore adoption73cfe12

lines 1–52why, one step back
1# $ click_
23Click is a Python package for creating beautiful command line interfaces4in a composable way with as little code as necessary. It's the "Command5Line Interface Creation Kit". It's highly configurable but comes with6sensible defaults out of the box.78It aims to make the process of writing command line tools quick and fun9while also preventing any frustration caused by the inability to10implement an intended CLI API.1112Click in three points:1314- Arbitrary nesting of commands15- Automatic help page generation16- Supports lazy loading of subcommands at runtime171819## A Simple Example2021```python22import click2324@click.command()25@click.option("--count", default=1, help="Number of greetings.")26@click.option("--name", prompt="Your name", help="The person to greet.")27def hello(count, name):28 """Simple program that greets NAME for a total of COUNT times."""29 for _ in range(count):30 click.echo(f"Hello, {name}!")3132if __name__ == '__main__':33 hello()34```3536```37$ python hello.py --count=338Your name: Click39Hello, Click!40Hello, Click!41Hello, Click!42```434445## Donate4647The Pallets organization develops and supports Click and other popular48packages. In order to grow the community of contributors and users, and49allow the maintainers to devote more time to the projects, [please50donate today][].5152[please donate today]: https://palletsprojects.com/donate