boto3:在S3中删除对象的最佳方法

0

【以下的问题经过翻译处理】 使用Python中的boto3有几种删除S3存储桶单个对象的方法。

S3.Client.delete_object()、S3.Bucket.delete_objects()、S3.Object.delete()等。

我不知道如何选择最适合我们代码的方法。

请您给我提供有关每个类具有什么特征以及选择适当方法的要点的信息。

profile picture
EXPERT
asked 5 months ago29 views
1 Answer
0

【以下的回答经过翻译处理】 从现在开始您应该使用S3.Client。AWS Python SDK团队不打算在boto3的资源接口中添加新功能。S3.BucketS3.Object实现资源接口。请查阅下方文档中的第一条注释。 https://boto3.amazonaws.com/v1/documentation/api/latest/guide/resources.html

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions