GCP python 文档有一个具有以下功能的脚本:
def upload_pyspark_file(project_id, bucket_name, filename, file):
"""Uploads the PySpark file in this directory to the configured
input bucket."""
print('Uploading pyspark file to GCS')
client = storage.Client(project=project_id)
bucket = client.get_bucket(bucket_name)
blob = bucket.blob(filename)
blob.upload_from_file(file)
我在脚本中创建了一个参数解析函数,该函数接受多个参数(文件名)以上传到 GCS 存储桶。我正在尝试调整上述函数来解析这些多个参数并上传这些文件,但不确定如何继续。我的困惑在于上面的“文件名”和“文件”变量。如何根据我的特定目的调整该功能?