title: Download csv file through python (url)
body: <p>I work on a project and I want to download a csv file from a url. I did some research on the site but none of the solutions presented worked for me.</p>
  
  <p>The url offers you directly to download or open the file of the blow I do not know how to say a python to save the file (it would be nice if I could also rename it)</p>
  
  <p>But when I open the url  with this code nothing happens.</p>
  
  <pre><code>import urllib
  url='https://data.toulouse-metropole.fr/api/records/1.0/download/?dataset=dechets-menagers-et-assimiles-collectes'
  
  testfile = urllib.request.urlopen(url)
  </code></pre>
  
  <p>Any ideas?</p>