lines = ['Putting a value ...',
'Getting value with only row key ...',
'Getting value with only row key and family...',
'Getting value with only row key and family and qualifier...',
'Getting value with row key which is not put...']
for line in lines:
print '%-59s' % line,
# ...
print 'OK'
这打印
Putting a value ... OK
Getting value with only row key ... OK
Getting value with only row key and family... OK
Getting value with only row key and family and qualifier... OK
Getting value with row key which is not put... OK
对于这项工作,您需要知道最长字符串的长度(59
在上面的示例中)。