import urllib2, sys
if len(sys.argv) !=3:
print "Usage: download.py <link> <saveas>"
sys.exit(1)
site = urllib2.urlopen(sys.argv[1])
meta = site.info()
print "Size: ", meta.getheaders("Content-Length")
f = open(sys.argv[2], 'wb')
f.write(site.read())
f.close()
I'm wondering how to display the file name and size before downloading and how to display the download progress of the file. Any help will be appreciated.