Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
pc10201
V2EX  ›  云计算

在BAE环境中如何引入requests库

  •  
  •   pc10201 · Dec 21, 2013 · 3451 views
    This topic created in 4621 days ago, the information mentioned may be changed or developed.
    我在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文件
    3 replies    1970-01-01 08:00:00 +08:00
    allenforrest
        1
    allenforrest  
       Dec 21, 2013
    去requests官网下载下来,直接放在BAE里你自己APP目录里。

    requests全python写成,无native动态库依赖,很方便。
    ooh
        2
    ooh  
       Dec 21, 2013
    bae允许写?
    likai
        3
    likai  
       Dec 21, 2013
    3.0允许了,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5553 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 621ms · UTC 08:24 · PVG 16:24 · LAX 01:24 · JFK 04:24
    ♥ Do have faith in what you're doing.