Mais conteúdo relacionado
Semelhante a Building Python Applications on Windows Azure (20)
Mais de Eric ShangKuan (16)
Building Python Applications on Windows Azure
- 2. NCTU CHT Microsoft
2000 ~ 2004 2007 ~ 2011 2011 ~ ?
上官林傑 (Eric) NTU Taipei GTUG
Technical Evangelist, MS 2004 ~ 2006 2009 ~ 2010
- 17. # init an azure table service instance
from azure import storage
ts = storage.TableService(account_name='<STORAGE_NAME>',
account_key='<STORAGE_KEY>')
# create table
ts.create_table('MY_TABLE_NAME')
# add an entity
ts.insert_entity('MY_TABLE_NAME', {
'PartitionKey': 'hello1234', 'RowKey': '20120610',
'name': 'Eric', 'say': 'PyCon Taiwan rocks!'
})
# list entities...
entities = ts.query_entities('MY_TABLE_NAME', '', 'name,say')
for entity in entities:
print '%s: %s' % (entity.name, entity.say)