You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
485 B
15 lines
485 B
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) |
|
|