Python 2.7 如何从Raspberry Pi向Firebase上传图像?
我无法使用Python将图像上载到Firebase。如果有人能提供一个代码片段,那将非常有帮助。请看一看,或者使用Firebase存储。从这些文件中:Python 2.7 如何从Raspberry Pi向Firebase上传图像?,python-2.7,firebase,raspberry-pi,firebase-storage,Python 2.7,Firebase,Raspberry Pi,Firebase Storage,我无法使用Python将图像上载到Firebase。如果有人能提供一个代码片段,那将非常有帮助。请看一看,或者使用Firebase存储。从这些文件中: # Import gcloud from google.cloud import storage # Enable Storage client = storage.Client() # Reference an existing bucket. bucket = client.get_bucket('projectid.appspot.co
# Import gcloud
from google.cloud import storage
# Enable Storage
client = storage.Client()
# Reference an existing bucket.
bucket = client.get_bucket('projectid.appspot.com')
# Upload a local file to a new file to be created in your bucket.
zebraBlob = bucket.get_blob('zebra.jpg')
zebraBlob.upload_from_filename(filename='/photos/zoo/zebra.jpg')
# Download a file from your bucket.
giraffeBlob = bucket.get_blob('giraffe.jpg')
giraffeBlob.download_as_string()