with concurrent.futures.ThreadPoolExecutor(maxworkers=100) as executor:…
- User
with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor: print(f"Generating {len(captchas)} login attempts..") results = executor.map(login_attempt, captchas)
How do i run this as many times as there are captchas? and pass each captcha to each function call? As simple as possible.
- Assistant
To run the
login_attemptfunction for each captcha in your list and ensure that each function call is passed its corresponding captcha, the code you currently have will work correctly. Theexecutor.mapmethod automatically takes care of passing each item (in this case, each captcha) to thelogin_attemptfunction:python