bash pip install click python import click python @click.command() def hello(): click.echo('Hello, World!') python @click.command() @click.option('--name', default='World', help='The person to greet.') def hello(name): click.echo(f'Hello, {name}!') python @click.group() def cli(): pass @cli.command() @click.option('--name', default='World', help='The person to greet.') def hello(name): click.echo(f'Hello, {name}!') @cli.command() def goodbye(): click.echo('Goodbye, World!') python import click @click.command() @click.argument('name') def hello(name): click.echo(f'Hello, {name}!') if __name__ == '__main__': hello() bash python script.py world bash Hello, world!


上一篇:
下一篇:
切换中文