while True:
is_first = False
cs = random.randint(int(col1),int(col2))
symbols = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'
rand = (''.join(choice(symbols) for i in range(cs)))
f = open(f'text.txt', 'a')
f.write(f'{rand}\n')
print(rand)
f = open(f'text.txt', 'a')
while True:
is_first = False
cs = random.randint(int(col1),int(col2))
symbols = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'
rand = (''.join(choice(symbols) for i in range(cs)))
f.write(f'{rand}\n')
print(rand)
f.close()
f = open(f'text.txt', 'a')
while True:
is_first = False
cs = random.randint(int(col1),int(col2))
symbols = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'
rand = (''.join(choice(symbols) for i in range(cs)))
if rand in f.read().splitlines():
continue
else:
f.write(f'{rand}\n')
print(rand)
import random
def generate_random_massive(col1, col2, size):
results = set()
while len(results) < size:
cs = random.randint(int(col1),int(col2))
symbols = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'
rand = (''.join(random.choice(symbols) for i in range(cs)))
results.update({rand})
return results
if __name__ == '__main__':
col1 = 16
col2 = 16
size = 1000
rands = generate_random_massive(col1, col2, size)
print(rands)
from itertools import product
symbols = 'abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_'
result = list(product(symbols, repeat = N))