title: How to accelerate download speed of a file using Python?
body: <p>I am trying to download a file located on the web through <code>write</code> function with the <code>wb</code> mode. Files are being downloaded too slowly when it is compared to the speed of downloading through a web browser (as I have a high-speed internet connection). How can I accelerate the download speed? Is there a better way of handling file download? </p>
  
  <p>Here is the way I use:</p>
  
  <pre><code>resp = session.get(download_url)
  with open(package_name + '.apk', 'wb+') as local_file:
      local_file.write(resp.content)
  </code></pre>
  
  <p>I have experimented that the download speeds of <code>requests</code> and <code>urllib3</code> libraries are almost the same. Here is the experimental result to download a <code>15 MB</code> file:</p>
  
  <ul>
  <li><code>requests</code>: <code>0:02:00.689587</code></li>
  <li><code>urllib3</code>: <code>0:02:05.833442</code></li>
  </ul>
  
  <p>p.s. My Python version is <code>3.7.0</code>, and my OS is <code>Windows 10 version 1903</code>.</p>
  
  <p>p.s. I have investigated the <a href="https://stackoverflow.com/questions/21196161/python-downloading-is-extremely-slow">reportedly similar question</a>, but the answers/comments did not work.</p>