【发布时间】:2021-04-06 10:38:35
【问题描述】:
我在 GCS 中有一个 .tar 文件,我希望能够将文件直接读入 python,而无需先在某处下载文件的中间步骤。
我在想这样的事情:
import gcsfs
fs = gcsfs.GCSFileSystem(project='my-google-project')
with fs.open('my_bucket/my_tar_file.tar', 'rb') as f:
tarfile.open(f)
但是f 是一个已经打开的文件连接,所以.open 当然再次不起作用。这可能吗?
【问题讨论】:
标签: python google-cloud-platform google-cloud-storage tar