在BAE环境中如何引入requests库
我在BAE的项目目录中requirements.txt添加了requests
然后部署这个程序
#coding=utf-8
f=open(r'/home/bae/log/log.txt','a+')
try:
import requests
r = requests.get('http://www.baidu.com')
test=r.text
f.writelines(test.encode('utf-8'))
except:
pass
finally:
f.writelines('error')
f.close()
好像没有生成log.txt文件
然后部署这个程序
#coding=utf-8
f=open(r'/home/bae/log/log.txt','a+')
try:
import requests
r = requests.get('http://www.baidu.com')
test=r.text
f.writelines(test.encode('utf-8'))
except:
pass
finally:
f.writelines('error')
f.close()
好像没有生成log.txt文件
本文由 vps网友提供,转载请注明出处
本文链接: https://www.vpsvsvps.com/discuss/a/1676471641414045696.html