title: Python running threads sequentially
body: <p>I'm experimenting with running code parallel in Python. </p>
  
  <p>My use case is as follows: I have a process that I need to run thousands of times. But due to it's dependency on a download I need to be careful how many I run at the same time (I have a limited number of requests each minute). I therefore would like to always run the function 10 times simultaneously, each time one is finished I would like to start up a new process.</p>
  
  <p>After doing some quick reading the threading module seems to be what I'm looking for. However, some small experiments seem to show that Python does not run the threads in paralell.</p>
  
  <p>When I run the following code</p>
  
  <pre><code>import threading
  import time
  
  wait = 0.4
  
  def f(x):
   for j in range(1,100):
      time.sleep(wait)
      print(x)
  
  
  threading.Thread(target = f(1)).start()
  threading.Thread(target = f(2)).start()
  </code></pre>
  
  <p>I get in the commandline</p>
  
  <pre><code>1
  1
  1
  1
  1
  </code></pre>
  
  <p>Not a singe 2 shows up untill all 100 ones are printed out.</p>
  
  <p>How does this come? In theory f(1) and f(2) should be running simultaneously right?</p>