title: multithreading or multiprocessing with a for loop
body: <p>So I have a code that is currently working. Data processing.
  So I get a bunch of data delimited by new line.
  My code is running on 1 by 1 process. I want to speed things up because processing leads for the company 1 by 1 takes a lot of time. Below is my code:</p>
  <pre><code>def at_answer(message):
      lines = message.text
      names_list = [y for y in (x.strip() for x in lines.splitlines()) if y]
      for x in names_list:
          lead = re.split(&quot;[: _=/+\-;]&quot;, x)
          currmonth = datetime.now().strftime('%m')
          curryear = datetime.now().strftime('%y')
  </code></pre>
  <p>I tried adding multithreading before the for x. but if I do so it will try to run multiple instances of one <code>x</code> in my list.
  If I remove the <code>for x in names_list</code> and add it to the <code>def thread</code>, I don't know if my code is messed-up.</p>
  <p>If someone can help me how to add multithreading or multiprocessing with the <code>for x in names_list:</code>.</p>