获取当前的桌面的路径
#然后将路径和Desktop拼接起来
desktop_path=os.path.join(os.path.expanduser("~"), 'Desktop')
url='https://www.gaitubao.com/jpg-gif-png/'
files={'file':open(desktop_path+r'\12.jpg','rb')}
res=requests.post(url,files=files)
print('成功',res.text)
获取当前的桌面的路径
#然后将路径和Desktop拼接起来
desktop_path=os.path.join(os.path.expanduser("~"), 'Desktop')
url='https://www.gaitubao.com/jpg-gif-png/'
files={'file':open(desktop_path+r'\12.jpg','rb')}
res=requests.post(url,files=files)
print('成功',res.text)
本文标题:简单上传文件
本文链接:https://www.haomeiwen.com/subject/hovarhtx.html
网友评论