Hello i have a loop its basically a name generator and i want to stop it at some point.I had the idea to stop it with a key.Because i cant stop it due to its high rate of generating words i cant input stop or anything its too fas.Like if i press Enter the generator should stop but i couldnt figure out how.And i had the idea of a timer when the generator generated 1000 words it would stop.All timers stopps/timers are accepted. here is mycode `
import time
from time import sleep
import random
import string
def run_bot():
x1 = random.choice(string.ascii_uppercase)
x2 = random.choice(string.ascii_lowercase)
x3 = random.choice(string.ascii_lowercase)
x4 = random.choice(string.ascii_lowercase)
x5 = random.choice(string.ascii_lowercase)
name = str(x1 + x2 + x3 +x4 +x5)
print(name)
while True:
for i in range(5):
run_bot()
`