蘭雅sRGB 个人笔记 https://262235.xyz
提供编程和电脑应用视频教程,工具和源代码
C, C++, Python Programming, Source Code, Video

旧Hexo博客 | Github | IP定位WebAPI | Docker Hub
编程中文文档 | 网盘分享 | 中文Linux命令

python requests 库学习

import requests
def  text():
    url = 'https://262235.xyz/gettime.php'
    r = requests.get(url)
    print(r.text)

def  headers():
    url = 'https://262235.xyz'
    r = requests.get(url)
    print(r.headers)

def  content():
    url = 'https://262235.xyz/logo/262235.png'
    r = requests.get(url)
    print(r.content)

def  savepng():
    url = 'https://262235.xyz/logo/262235.png'
    r = requests.get(url)
    with open('logo.png', mode='wb') as file:
        file.write(r.content)

def  save7zip():
    url = 'https://262235.xyz/linux-command/linux-command.7z'
    r = requests.get(url)
    with open('linux-command.7z', mode='wb') as file:
        file.write(r.content)

text()
headers()
# content()
# savepng()
# save7zip()
本原创文章自由转载,转载请注明本博来源及网址 | 当前页面:蘭雅sRGB 个人笔记 » python requests 库学习