发布时间:2019-08-24 09:32:10编辑:auto阅读(1881)
# Python 2 code
import urllib
import urllib2
import requests
url = 'http://192.168.1.100/test.zip'
print "downloading with urllib"
urllib.urlretrieve(url, "code.zip")
print "downloading with urllib2"
f = urllib2.urlopen(url)
data = f.read()
with open("code2.zip", "wb") as code:
code.write(data)
print "downloading with requests"
r = requests.get(url)
with open("code3.zip", "wb") as code:
code.write(r.content)
上一篇: Python chardet 字符编码判
下一篇: 详解Python中re.sub
51299
50748
41344
38157
32628
29524
28374
23246
23214
21537
1611°
2346°
1946°
1888°
2222°
1933°
2619°
4397°
4239°
3010°