Holger Frey
3 months ago
2 changed files with 16 additions and 0 deletions
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
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) |
||||
|
Loading…
Reference in new issue