我这样做已经有一段时间了。
过去两个月一切正常,当尝试在 firestore 上更新时,突然出现此错误:“带有前导 alpha 的元素中的非字母字符:”。我什至不知道从哪里开始寻找问题。
# returns true if update was successful
def UpdateUser(self, user):
try:
# update will fail if it cant find an already existing document
doc_ref = self._db.collection(USER).document(user._username)
# update the values | this will fail if it doesn't exist
doc_ref.update({
u'Username': user._username,
u'Password': user._password,
# u'Time Created': user._time_created,
u'Last logged in': user._last_logged_in,
u'Active': user._active,
u'Phone': user._phone,
u'Address': user._address,
u'State': user._state,
u'City': user._city,
u'Zipcode': user._zipcode,
u'Stripe Customer Id': user._stripe_customer_id,
u'Email Activated': user._email_activated,
u'Full Name': user._full_name,
u'Id': …Run Code Online (Sandbox Code Playgroud) 我有很多编码经验,但Python对我来说是新的领域.
我正在使用CoinbaseExchangeAuth类来访问GDAX API的专用端点.我写了一些简单的代码......
api_url = 'https://public.sandbox.gdax.com/'
auth = CoinbaseExchangeAuth(API_KEY, API_SECRET, API_PASS)
Run Code Online (Sandbox Code Playgroud)
(注意我已经准确地定义了api密钥,秘密并在这些代码行之前正确传递 - 对于沙箱)
然后我写道:
r = requests.get(api_url + 'accounts', auth=auth)
Run Code Online (Sandbox Code Playgroud)
运行代码并得到此错误:
文件"a:\ PythonCryptoBot\Bot1.0\CoinbaseExhangeAuth.py",第16行,在call signature = hmac.new(hmackey,message,hashlib.sha256)文件"C:\ Users\Dylan\AppData\Local\Programs\Python\Python35-32\lib\hmac.py",第144行,在新的返回HMAC(key,msg,digestmod)文件"C:\ Users\Dylan\AppData\Local\Programs\Python\Python35-32\lib\hmac.py",第84行,在__init_ self.update(msg)文件"C:\ Users\Dylan\AppData\Local\Programs\Python\Python35-32\lib\hmac.py",第93行,更新自我.inner.update(msg)TypeError:必须在散列之前对Unicode对象进行编码
另请注意,我尝试过API_KEY.encode('utf-8')和其他人一样. - 似乎没有做任何事情.
我一直在努力教自己如何使用Android工作室,但我遇到了障碍,这段代码有什么问题?它不会让我使用绘图设置为图像?
public void obama(){
Switch s = (Switch)findViewById(R.id.obamaswitch);
s.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ImageView p = (ImageView)findViewById(R.id.obamahere);
p.setImageDrawable(R.drawable.brock);
}
});
}
Run Code Online (Sandbox Code Playgroud) 我正在免费试用 Google Firestore,并且我无法查询任何数据,甚至可以在我的 Google Cloud Platform 上查看它。我不知道有上限吗?在哪里可以找到有关我可以免费试用多少金额的信息?如何升级当前项目以便再次访问我的数据?
这就是响应的内容
{
"error": {
"code": 429,
"message": "Quota exceeded.",
"status": "RESOURCE_EXHAUSTED"
}
}
Run Code Online (Sandbox Code Playgroud)