【发布时间】:2015-07-31 11:11:09
【问题描述】:
我在我的 Amazon S3 服务器上使用 Python Boto 库。
我想得到bucket 对象作为迭代器,所以当我写Bucket.next() 或类似的东西时,它会给我下一个迭代器。
我该怎么做?
【问题讨论】:
标签: python-2.7 amazon-s3 boto
我在我的 Amazon S3 服务器上使用 Python Boto 库。
我想得到bucket 对象作为迭代器,所以当我写Bucket.next() 或类似的东西时,它会给我下一个迭代器。
我该怎么做?
【问题讨论】:
标签: python-2.7 amazon-s3 boto
使用get_all_buckets()
from boto.s3 import Connection
connection = Connection()
buckets = connection.get_all_buckets() # returns a list of bucket objects
现在您可以遍历buckets。
【讨论】: