最近搜索

异常的捕获

浏览:790
管理员 2020-04-04 06:38

python 异常的捕获  

python 异常的处理


def request_download(imgUrl,fileUrl):
    try:
        r = requests.get(imgUrl)
        with open(fileUrl, 'wb') as f:
            f.write(r.content)
    except Exception:
        print("下载失败")


联系站长

站长微信:xiaomao0055

站长QQ:14496453