我对gcloud和python3有点困惑
在python3 env中安装gcloud后,我尝试在App Engine灵活环境中使用Quickstart for Python.
它说'你需要Google Cloud SDK',所以我安装了SDK.SDK(包括SDK)之后的所有过程,都需要python2 env.
这是一个问题,是不可能用python3(官方)运行gcloud呢?(SDK和python2与gcloud库是最好的方法吗?)
在书籍中搜索了一段时间后,在stackoverflow和一般网络上,我发现很难找到对fortran参数意图之间真正差异的直接解释.我理解它的方式是这样的:
intent(in) - 实际参数被复制到条目处的伪参数.intent(out) - 伪参数指向实际参数(它们都指向内存中的相同位置).intent(inout) - 伪参数在本地创建,然后在过程完成时复制到实际参数.如果我的理解是正确的,那么我也想知道为什么人们想要使用intent(out),因为intent(inout)需要更少的工作(不复制数据).
处理Google云端存储的常规签名URL(查询字符串身份验证)令人沮丧.
Google云端存储签名网址示例 - >这是否是整个互联网中唯一可用于生成Google云端存储签名网址的代码?如果需要,我应该全部阅读并手动修改Pure Python GAE吗?
当你将它与已经包含在任何SDK中的AWS S3 getAuthenticatedURL()进行比较时,这很荒谬......
我错过了一些明显的东西,还是每个人都面临同样的问题?这是怎么回事?
python google-app-engine google-cloud-storage gcloud-python google-cloud-python
我正在开发使用Python编写并使用Endpoints API的Google App Engine应用程序.与此同时,我正在编写Chrome扩展程序以与Endpoints API进行交互.我一直在使用Endpoints API和授权遇到很多问题.目前,这是我的设置:
from google.appengine.ext import endpoints
from protorpc import message_types
from protorpc import remote
ALLOWED_CLIENT_IDS = ['client_id_from_google_api_console',
endpoints.API_EXPLORER_CLIENT_ID]
@endpoints.api(name='my_api',version='v1', description='My API',
allowed_client_ids=ALLOWED_CLIENT_IDS)
class MyApi(remote.Service):
@endpoints.method(message_types.VoidMessage, DeviceListResponse,
name='user.device.list', path='user/device/list',
http_method='GET')
def user_device_list(self, request):
current_user = endpoints.get_current_user()
if current_user is None:
raise endpoints.UnauthorizedException('You must authenticate first.')
if current_user.user_id() is None:
raise endpoints.NotFoundException("Your user id was not found.")
return DeviceListResponse(devices=[]) #Hypothetically return devices
api_service = endpoints.api_server([MyApi], restricted=False)
Run Code Online (Sandbox Code Playgroud)
JS的起源包括:chrome-extensions:// chrome_app_id
var apiRoot = "https://my_app_id.appspot.com/_ah/api";
var …Run Code Online (Sandbox Code Playgroud) google-app-engine google-chrome-extension oauth-2.0 python-2.7 google-cloud-endpoints
我试图找出谷歌的GData API(之间的差异http://code.google.com/p/gdata-python-client/)和谷歌的API客户端库的Python(http://code.google.com/ p/google-api-python-client /).
他们似乎都是谷歌.哪个是官方的?他们有什么不同?第二个似乎主要使用OAuth.
如果有人有任何知识或使用经验,那么获得一些信息会很棒!
PS:我虽然把它放在超级用户身上,但因为它与编程有关,我认为这会更好.
python gdata-api gdata google-client google-api-python-client
这个问题只是为了证实我对这个概念很清楚.
据我所知,Google Cloud Endpoints是Google实施的REST服务,因此他们无法将任何"会话"数据保留在内存中,因此:
它是否正确?如果是这样,这在性能方面是否真的很好?
我打算编写一个Python程序来检查文件是否在我的Google云端存储的某个文件夹中,基本的想法是获取list文件夹中的所有对象,文件名list,然后检查文件abc.txt是否在文件名list.
现在的问题是,看起来Google只提供了一种获取方式obj list,即uri.get_bucket()下面的代码来自https://developers.google.com/storage/docs/gspythonlibrary#listing-objects
uri = boto.storage_uri(DOGS_BUCKET, GOOGLE_STORAGE)
for obj in uri.get_bucket():
print '%s://%s/%s' % (uri.scheme, uri.bucket_name, obj.name)
print ' "%s"' % obj.get_contents_as_string()
Run Code Online (Sandbox Code Playgroud)
缺点uri.get_bucket()是,看起来它首先得到所有的对象,这是我不想要的,我只需要得到特定文件夹的obj名称list(例如gs//mybucket/abc/myfolder),这应该很快.
有人可以帮忙回答吗?感谢每一个答案!
python google-cloud-storage gcloud-python google-cloud-python
有哪些方法可以使用python和oauth2.0导入谷歌联系人?
我们成功获得了凭据,我们的应用程序请求访问联系人,但在获得凭据后,我找不到发现联系人api的方法.
所以像:
from apiclient.discover import build
import httplib2
http = httplib2.Http()
#Authorization
service = build("contacts", "v3", http=http)
Run Code Online (Sandbox Code Playgroud)
给我们UnknownApiNameOrVersion例外.看起来联系人API不在apiclient支持的API列表中.
我正在寻找替代方法.
python google-api contacts oauth-2.0 google-api-python-client
我有以下代码,我不知道如何打印下一页的链接,如何进入下一页?
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
import pprint
from apiclient.discovery import build
def main():
service = build("customsearch", "v1",
developerKey="")
res = service.cse().list(
q='lectures',
cx='013036536707430787589:_pqjad5hr1a',
num=10, #Valid values are integers between 1 and 10, inclusive.
).execute()
for value in res:
#print value
if 'items' in value:
for results in res[value]:
print results['formattedUrl']
if __name__ == '__main__':
main()
Run Code Online (Sandbox Code Playgroud) 谷歌在这里有一个OAuth2客户端的例子
我完全是OAuth2的新手,我希望在我将OAuth2与我的应用程序集成之前让这个示例正常工作.我所做的是以下内容:
python moderator.py该应用程序打开一个浏览器,我可以(作为用户)授权应用程序访问我的帐户.但谷歌这样抱怨(400 Bad Request):
Error: redirect_uri_mismatch
The redirect URI in the request: http://localhost:8080/ did not match a registered redirect URI
Learn more
Request Details
from_login=1
scope=https://www.googleapis.com/auth/moderator
response_type=code
access_type=offline
redirect_uri=http://localhost:8080/
approval_prompt=auto
as=-xxxxxxxxxxxxx
pli=1
client_id=xxxxxxxxxxx.apps.googleusercontent.com
authuser=0
hl=en
Run Code Online (Sandbox Code Playgroud)
我想localhost:8080来自一个由moderator.py启动的内部Web服务器.我的问题是:有人得到这个例子吗?我需要哪些其他组件(apache配置,DNS,...)
我对OAuth2非常困惑,任何帮助将不胜感激.