category category - 1 year ago 106
Python Question

azure - list containers in python

I'm trying to list the containers under an azure account using the python sdk - why do I get the following?

>>>'x', account_key='x').list_containers()
>>> < at 0x7f7cf935fa58>

Surely the above is a call to the function and not a reference to the function itself.

Answer Source

you get the following according to source code it return return ListGenerator(resp, self._list_containers, (), kwargs)

you can access what you want as follow:

>>>'x', account_key='x')
>>>containers = blob_service.list_containers() 
>>>for c in containers: 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download