title: Python: POST multiple multipart-encoded files
body: <p>As described here, it is possible to send multiple files with one request:
  <a href="https://stackoverflow.com/questions/18179345/uploading-multiple-files-in-a-single-request-using-python-requests-module">Uploading multiple files in a single request using python requests module</a></p>
  
  <p>However, I have a problem generating these multiple filehandlers from a list.
  So let's say I want to make a request like this:</p>
  
  <pre><code>sendfiles = {'file1': open('file1.txt', 'rb'), 'file2': open('file2.txt', 'rb')}
  r = requests.post('http://httpbin.org/post', files=sendfiles)
  </code></pre>
  
  <p>How can I generate <em>sendfiles</em> from the list <em>myfiles</em>?</p>
  
  <pre><code>myfiles = ["file1.txt", "file20.txt", "file50.txt", "file100.txt", ...]
  </code></pre>