NoobAI-NAI-XL-Wildcards / randumbizer.py
Samsara
Upload 3 files
caba9f1 verified
raw
history blame
939 Bytes
import random
import pyperclip
def read_random_lines(artist_file="artist.txt", sheet_file="Sheet1.txt"):
with open(artist_file, "r") as artist, open(sheet_file, "r") as sheet:
artist_lines = artist.readlines()
sheet_lines = sheet.readlines()
random.shuffle(artist_lines)
while artist_lines:
sheet_line = random.choice(sheet_lines).strip()
num_artist_lines = random.randint(1, 4)
selected_artist_lines = artist_lines[:num_artist_lines]
artist_lines = artist_lines[num_artist_lines:]
result = f"{sheet_line}, " + ", ".join(line.strip() for line in selected_artist_lines)
print(result)
pyperclip.copy(result)
print("\nContent copied to clipboard.")
input("\nPress Enter to get more lines...\n")
print("\nAll lines have been displayed.")
read_random_lines()