2013-06-26 50 views

回答

2

退房的博托参考文档:boto API reference

您还可以使用内置的dir()函数获取对象属性列表,这对于从Python CLI使用不熟悉的库进行快速属性搜索非常方便:

>>> import boto.s3.key 
>>> k = boto.s3.key.Key('somebucket') 
>>> dir(k) 
['BufferSize', 'DefaultContentType', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add_email_grant', 'add_user_grant', 'base64md5', 'bucket', 'cache_control', 'change_storage_class', 'close', 'closed', 'compute_md5', 'content_disposition', 'content_encoding', 'content_language', 'content_type', 'copy', 'delete', 'delete_marker', 'encrypted', 'endElement', 'etag', 'exists', 'filename', 'generate_url', 'get_acl', 'get_contents_as_string', 'get_contents_to_file', 'get_contents_to_filename', 'get_file', 'get_md5_from_hexdigest', 'get_metadata', 'get_torrent_file', 'get_xml_acl', 'handle_encryption_headers', 'handle_version_headers', 'is_latest', 'last_modified', 'make_public', 'md5', 'metadata', 'mode', 'name', 'next', 'open', 'open_read', 'open_write', 'owner', 'path', 'provider', 'read', 'resp', 'send_file', 'set_acl', 'set_canned_acl', 'set_contents_from_file', 'set_contents_from_filename', 'set_contents_from_stream', 'set_contents_from_string', 'set_metadata', 'set_xml_acl', 'size', 'source_version_id', 'startElement', 'storage_class', 'update_metadata', 'version_id']