【问题标题】:Boto Amazon S3 - Get bucket as iteratorBoto Amazon S3 - 获取存储桶作为迭代器
【发布时间】:2015-07-31 11:11:09
【问题描述】:

我在我的 Amazon S3 服务器上使用 Python Boto 库。

我想得到bucket 对象作为迭代器,所以当我写Bucket.next() 或类似的东西时,它会给我下一个迭代器。

我该怎么做?

【问题讨论】:

    标签: python-2.7 amazon-s3 boto


    【解决方案1】:

    使用get_all_buckets()

    from boto.s3 import Connection
    connection = Connection()
    buckets = connection.get_all_buckets()  # returns a list of bucket objects
    

    现在您可以遍历buckets

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-19
      • 2016-08-25
      • 1970-01-01
      • 2011-01-29
      • 1970-01-01
      相关资源
      最近更新 更多