擅长:python、mysql、java
<p>假设博图.cfg配置为区域、安全、访问等</p>
<pre><code>from boto.s3.connection import S3Connection
conn = S3Connection()
if conn.lookup('bucketnamehere') is not None:
print('bucket already exists')
</code></pre>
<p>如果你的boto不支持连接查找,您可能希望使用head而不是get(请参见:<a href="http://boto.readthedocs.org/en/latest/ref/s3.html#module-boto.s3.connection" rel="nofollow">http://boto.readthedocs.org/en/latest/ref/s3.html#module-boto.s3.connection</a>)</p>
^{pr2}$