try:
    from urllib.request import urlretrieve
except ImportError:
    from urllib.request import urlretrieve
urlretrieve('http://example.org', 'outfile.dat')
Downloading a file from the command line using python