I'm a newbie of Python and trying to get to know about machine learning. Following is a code bock that I get from Udacity assignnment.
def maybe_download(filename, expected_bytes, force=False):
"""Download a file if not present, and make sure it's the right size."""
dest_filename = os.path.join(data_root, filename)
if force or not os.path.exists(dest_filename):
print('Attempting to download:', filename)
filename, _ = urlretrieve(url + filename, dest_filename, reporthook=download_progress_hook)
print('\nDownload Complete!')
statinfo = os.stat(dest_filename)
if statinfo.st_size == expected_bytes:
print('Found and verified', dest_filename)
else:
raise Exception(
'Failed to verify ' + dest_filename + '. Can you get to it with a browser?')
return dest_filename
I can understand most of the part. However, I'm very confused about filename, _ = urlretrieve(...)
part. What is this assign to? I trace it in debugger and find that filename = '.\\notMNIST_large.tar.gz'
remain no change before or after this expression.
So my question what does this filename, _ = urlretrieve(...)
really mean? Is this some kind of advance technique to assign value in hidden expression?