小编Myl*_*les的帖子

自更新以来,appengine remote_api_shell无法使用应用程序默认凭据

我最近将我的gcloud库从118.0.0更新到132.0.0,并且remote_api_shell立即不再有效.我经历了一些重新登录的排列,通过gcloud设置应用程序默认凭据,并使用服务帐户和环境变量.所有排列都失败,并显示相同的错误消息:

    Traceback (most recent call last):
  File "/Users/mbostwick/google-cloud-sdk/bin/remote_api_shell.py", line 133, in <module>
    run_file(__file__, globals())
  File "/Users/mbostwick/google-cloud-sdk/bin/remote_api_shell.py", line 129, in run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 160, in <module>
    main(sys.argv)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 156, in main
    oauth2=True)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/remote_api_shell.py", line 74, in remote_api_shell
    secure=secure, app_id=appid)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 769, in ConfigureRemoteApiForOAuth
    rpc_server_factory=rpc_server_factory)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 839, in ConfigureRemoteApi
    app_id = GetRemoteAppIdFromServer(server, path, rtok)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 569, in GetRemoteAppIdFromServer
    response = server.Send(path, payload=None, **urlargs)
  File "/Users/mbostwick/google-cloud-sdk/platform/google_appengine/google/appengine/tools/appengine_rpc_httplib2.py", line 259, in Send
    NeedAuth() …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine remoteapi gcloud

6
推荐指数
1
解决办法
729
查看次数

在python中创建随机长度的列表

我正在用python编写一个程序。在其中,我想生成一个列表。此列表将从 1 开始并以 1 递增[1, 2, 3, 4, 5, etc.]

但是,我希望列表的长度是随机的,介于 3 个数字和 8 个数字之间。例如,在一次运行中,列表可能会生成[1, 2, 3, 4],在另1, 2, 3, 4, 5, 6]一次运行中可能会生成,另一次运行可能会生成[1, 2, 3],等等。

我知道如何使列表生成随机数,但不知道如何以随机长度递增数字。感谢您的时间。顺便说一下,我正在使用 Python 2.7。

python python-2.7

2
推荐指数
1
解决办法
4916
查看次数