title: Extracting zip file contents to specific directory in Python 2.7
body: <p>This is the code I am currently using to extract a zip file that lives in the same current working directory as the script. How can I specify a different directory to extract to?</p>
  
  <p>The code I tried is not extracting it where I want.</p>
  
  <pre><code>import zipfile
  
  fh = open('test.zip', 'rb')
  z = zipfile.ZipFile(fh)
  for name in z.namelist():
      outfile = open(name, 'wb')
      outfile.write('C:\\'+z.read(name))
      outfile.close()
  fh.close()
  </code></pre>