Saturday, 15 August 2015

python - Is param['pagetoken'] a syntax error in sample Google Reports Code? -



python - Is param['pagetoken'] a syntax error in sample Google Reports Code? -

i've been trying decipher next block of code google reports api sample

it appears though term param['pagetoken'] should params['pagetoken']

am misreading this?

all_logins = [] page_token = none params = {'applicationname': 'login', 'userkey': 'all', 'starttime': start_time} while true: try: if page_token: param['pagetoken'] = page_token current_page = reports_service.activities().list(**params).execute() all_logins.extend(current_page['items']) page_token = current_page.get('nextpagetoken') if not page_token: break except errors.httperror error: print 'an error occurred: %s' % error break

from can tell on study page, param[...] typo. param not referred anywhere else in post, params is.

python python-2.7 google-reporting-api

No comments:

Post a Comment