commands.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ecodash 作者: Servir-Mekong 项目源码 文件源码
def run(self, unused_args, unused_config):
    """Generates and opens a URL to get auth code, then retrieve a token."""

    auth_url = ee.oauth.get_authorization_url()
    webbrowser.open_new(auth_url)

    print """
    Opening web browser to address %s
    Please authorize access to your Earth Engine account, and paste
    the resulting code below.
    If the web browser does not start, please manually browse the URL above.
    """ % auth_url

    auth_code = raw_input('Please enter authorization code: ').strip()

    token = ee.oauth.request_token(auth_code)
    ee.oauth.write_token(token)
    print '\nSuccessfully saved authorization token.'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号