import click import random import pyperclip @click.command() @click.argument("length", default=100, type=int) def generate_random_number_list(length=100): """ generates a new line separated list of integers and copies it to the clipboard """ numbers = list(range(1, length + 1)) random.shuffle(numbers) integer_list = "\n".join(str(i) for i in numbers) pyperclip.copy(integer_list) click.echo("Copied to clipboard:", err=True) click.echo(integer_list)