我找不到使用 python 将本地计算机中的数据集写入谷歌云存储的方法。我进行了很多研究,但没有找到任何与此相关的线索。需要帮助,谢谢
简单的例子,使用谷歌云 https://googlecloudplatform.github.io/google-cloud-python/Python 库:
from google.cloud import storage
def upload_blob(bucket_name, source_file_name, destination_blob_name):
"""Uploads a file to the bucket."""
storage_client = storage.Client()
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.blob(destination_blob_name)
blob.upload_from_filename(source_file_name)
print('File {} uploaded to {}.'.format(
source_file_name,
destination_blob_name))
更多示例位于此 GitHub 存储库中:https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/storage/cloud-client https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/storage/cloud-client
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)