答案 0 :(得分:0)
正如@shmosel所说,你可以使用REPLACE函数和UPDATE
import boto3
region_name = 'us-east-1'
aws_access_key_id = 'YOUR_ACCESS_KEY'
aws_secret_access_key = 'YOUR_SECRET_KEY'
PAGE_SIZE = 20
endpoint_url = 'https://mturk-requester-sandbox.us-east-1.amazonaws.com'
client = boto3.client('mturk',
endpoint_url = endpoint_url,
region_name = region_name,
aws_access_key_id = aws_access_key_id,
aws_secret_access_key = aws_secret_access_key,
)
qualification_id='9W4ZQKNWM3FZ5HGM2070'
response = client.list_workers_with_qualification_type(
QualificationTypeId=qualification_id,
Status='Granted',
MaxResults=PAGE_SIZE
)
next_token = response['NextToken']
qualification_count = response['NumResults']
while (response['NumResults'] == PAGE_SIZE):
print "Using next token of {}".format(next_token)
response = client.list_workers_with_qualification_type(
QualificationTypeId=qualification_id,
Status='Granted',
MaxResults=PAGE_SIZE,
NextToken=next_token
)
next_token = response['NextToken']
qualification_count += response['NumResults']
print "There are {} Workers in Qualification {}".format(qualification_count, qualification_id)