2024-09-26 18:00:13 发布
网友
对不起,我对驾驶API还不太熟悉。你知道吗
我从Google在Performance Tips上的帖子中了解到,在上传到Google Drive之前,我会向gzip推荐。但是,我没有找到一种方法来实现gzip,在上传之前使用python3driveapi v3压缩文件,在上传之后解压文件。你知道吗
非常感谢!你知道吗
我认为在线查看Python实现的教程会有所帮助。在Python的gzip — Support for gzip files上,您可以阅读他们的一些代码片段:
如何读取压缩文件的示例:
import gzip with gzip.open('file.txt.gz', 'rb') as f: file_content = f.read()
如何GZIP压缩现有文件的示例:
import gzip import shutil with open('file.txt', 'rb') as f_in, gzip.open('file.txt.gz', 'wb') as f_out: shutil.copyfileobj(f_in, f_out)
我认为在线查看Python实现的教程会有所帮助。在Python的gzip — Support for gzip files上,您可以阅读他们的一些代码片段:
如何读取压缩文件的示例:
如何GZIP压缩现有文件的示例:
相关问题 更多 >
编程相关推荐