手写归并排序算法

day8-字典和集合

  返回  

python:从placekitten上拉取一只猫

2021/7/21 21:08:09 浏览:

根据小甲鱼的python课程实现的小练习

代码:

import urllib

response = urllib.urlopen("http://placekitten.com/300/200")

cat_img = response.read()

#print(cat_img)

with open('cat_300_200.jpg', 'wb') as f:
    f.write(cat_img)

运行:
在这里插入图片描述
查看respond对象:

>>> 
============ RESTART: E:\pythonSave\download_webs\download_cat.py ============
>>> response.geturl()
'http://placekitten.com/300/200'
>>> print(response.info())
Date: Wed, 21 Jul 2021 12:55:00 GMT

Content-Length: 8242

Connection: close

Cache-Control: public, max-age=86400

Expires: Thu, 31 Dec 2020 20:00:00 GMT

Vary: User-Agent

Access-Control-Allow-Origin: *

CF-Cache-Status: HIT

Age: 43882

Accept-Ranges: bytes

Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Qq%2FEuEpoeSr0TYqF9n5KoChcrfVzgjej1KsygH5y44RA3efGQi3i2cX63iyw5ZniDikBS5YBvaZ1uphHMejcSkfMOb3sggwkXe4ftOvD7eivggFfEzdz96bDmj7QZdX0xgU%3D"}],"group":"cf-nel","max_age":604800}

NEL: {"report_to":"cf-nel","max_age":604800}

Server: cloudflare

CF-RAY: 672494c16eaf0cb3-LAX

alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
>>> response.getcode()
200
>>> 

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号