def billRecords(date,keywords): #初始化REST SDK rest = REST(serverIP,serverPort,softVersion) rest.setAccount(accountSid,accountToken) rest.setAppId(appId) result = rest.billRecords(date,keywords) for k,v in result.iteritems(): print '%s:%s' % (k, v) #billRecords('查询方式','查询条件')