当我使用flickr api时,我收到此错误

时间:2015-06-17 09:57:49

标签: flickr

import flickrapi
api_key = '<api key>'
api_password = '<api secret>'
flickrclient = flickrapi.FlickrAPI(api_key, api_password)
favourites = flickrClient.favorites_getPublicList(user_id='132339441@N02')
photos = flickr.photos_search(user_id='132339441@N02', per_page='10')
sets = flickr.photosets_getList(user_id='132339441@N02')
for photo in favourites.photos[0].photo:
    print photo['title']

错误是 Traceback(最近一次调用最后一次):   文件&#34; F:\ web \ joke.py&#34;,第5行,in     favorites = flickrClient.favorites_getPublicList(user_id =&#39; 132339441 @ N02&#39;) NameError:name&#39; flickrClient&#39;未定义

1 个答案:

答案 0 :(得分:1)

您正在使用flickrclientc定义flickrClient,其中首都为C

所以将flickrclient更改为flickrClient

flickrClient = flickrapi.FlickrAPI(api_key, api_password)