title: Iterate through files
body: <p>I'm trying to adapt someone's code for my (Windows 7) purposes. His is unfortunately UNIX specific. He does</p>
  
  <pre><code>dir_ = pathlib.PosixPath(str(somePathVariable))
  os.chdir(str(dir_))
  for pth in dir_:        
      # some operations here
  </code></pre>
  
  <p>Running this, I got (not surprisingly)</p>
  
  <pre><code>NotImplementedError: cannot instantiate 'PosixPath' on your system
  </code></pre>
  
  <p>I looked into the documentation for <code>pathlib</code> and thought yeah, I should just be able to change <code>PosixPath</code> to <code>Path</code> and I would be fine. Well, then <code>dir_</code> generates a <code>WindowsPath</code> object. So far, so good. However, I get </p>
  
  <pre><code>TypeError: 'WindowsPath' object is not iterable
  </code></pre>
  
  <p><code>pathlib</code> is at version 1.0, what am I missing? The purpose is to iterate through files in the specific directory. Googling this second error gave <em>0</em> hits. </p>
  
  <p>Remark: Could not use <code>pathlib</code> as a tag, hence I put it into the title.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I have Python 2.7.3 and  pathlib 1.0 </p>