python 使用urllib2下载文件

#! usr/bin/python 
#coding=utf-8
import urllib2

fp = open('test', 'wb')
req = urllib2.urlopen('http://192.168.230.138/index.zip')
for line in req:
    if not line:
        break
    fp.write(line)
fp.close()
原文地址:https://www.cnblogs.com/zheh/p/7656069.html