-
Download from URLPython 2015. 1. 22. 22:16
import urllib2
url = "http://fandu.tistory.com/attachment/cfile7.uf@21559C3D54BBB1313AF043.exe"
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(file_name,'wb')
meta = u.info()
file_size = int(meta.getheaders("Content-Length")[0])
print "Downloading: %s Bytes: %s" % (file_name, file_size)
file_size_dl = 0
block_sz = 8192
while True:
buffer = u.read(block_sz)
if not buffer:
break
file_size_dl += len(buffer)
f.write(buffer)
f.close()
download 경로는 광준이형블로그로 설정!
'Python' 카테고리의 다른 글
PE Viewer Python 오픈소스 (0) 2015.08.06 DLL Injector (4) 2015.01.28 Python PortScanner (0) 2015.01.22 Python Web Scanner (0) 2015.01.22 Python ImageHacking (0) 2015.01.21