import random import subprocess from threading import Thread results = [] start_processes = 6 def run_command(count, result_storage): cmd = subprocess.check_output(['ping', '-c', 5, str(choice) + '.com'], text=True) result_storage.append(cmd) threads = [] for _ in range(start_processes): x = random.randint(3, 4) print(x) choice = random.choice(list('1234567890abcdefghigklmnopqrstuvyxwz', k=x)) print(choice) t = Thread(target=run_command, args=[count, results]) t.start() threads.append(t) for t in threads: t.join()
Ошибку выдает:
3 Traceback (most recent call last): File "/media/sf_soft/vsc/thread.py", line 17, in <module> choice = random.choice(list('1234567890abcdefghigklmnopqrstuvyxwz', k=x)) TypeError: list() takes no keyword arguments
Как написать?