Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CLI module - click
#1
hello any one please help with my code to get standard input from username and print it
import click

@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name',
              help='The person to greet.')
def hello(count, name):
    """Simple program that greets NAME for a total of COUNT times."""
    for x in range(count):
        click.echo('Hello %s!' % name)

if __name__ == '__main__':
    hello()
Reply


Messages In This Thread
CLI module - click - by suraj522 - Sep-11-2019, 07:01 AM
RE: CLI module - click - by stranac - Sep-11-2019, 07:11 AM
RE: CLI module - click - by suraj522 - Sep-11-2019, 07:31 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020