title: Python Threading with varying arguments (Python 2.4.3)
body: <p>I am learning the threading and concurrency part in python, and I choose an example where I do an <code>os.walk()</code> to get a list of files from a directory, populate it to an array using <code>os.path.join()</code> and then use threading to change ownership of these files. The purpose of this script is to learn threading. My code is</p>
  
  <pre><code>for root, dir, file in os.walk("/tmpdir/"):
      for name in file:
          files.append(os.path.join(root, name))
  
  def filestat(file):
      print file ##The code to chown will go here. Writing it to just print the file for now.
  
  thread = [threading.Thread(target=filestat, args="filename") for x in range(len(files))]
  print thread ##This will give me the total number of thread objects that is created
  for t in thread:
      t.start() ##This will start the thread execution
  </code></pre>
  
  <p>This will print the "filename" when executed for <code>len(files)</code> times. However, I wanted to pass the filename inside the list files as the argument to the function. What should I do? </p>