Package ivs :: Package inout :: Module http
[hide private]
[frames] | no frames]

Module http

source code

Read or download files from the internet.

Functions [hide private]
string(, FancyURLopener)
download(link, filename=None)
Download a file from a link.
source code
Function Details [hide private]

download(link, filename=None)

source code 

Download a file from a link.

If you want to download the contents to a file, supply filename. The function will return that filename as a check.

If you want to read the contents immediately from the url, just give the link, and a fileobject and the url object will be returned. Remember to close the url after finishing reading!

Parameters:
  • link (string) - the url of the file
  • filename (str) - the name of the file to write to (optional)
Returns: string(, FancyURLopener)
output filename(, url object)