title: os.walk multiple directories at once
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3211041/how-to-join-two-generators-in-python">How to join two generators in Python?</a>  </p>
  </blockquote>
  
  
  
  <p>Is there a way in python to use os.walk to traverse multiple directories at once?</p>
  
  <pre><code>my_paths = []
  path1 = '/path/to/directory/one/'
  path2 = '/path/to/directory/two/'
  for path, dirs, files in os.walk(path1, path2):
      my_paths.append(dirs)
  </code></pre>
  
  <p>The above example doesn't work (as os.walk only accepts one directory), but I was hoping for a more elegant solution rather than calling os.walk twice (plus then I can sort it all at once). Thanks.</p>