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']
the error is Traceback (most recent call last): File "F:\web\joke.py", line 5, in favourites = flickrClient.favorites_getPublicList(user_id='132339441@N02') NameError: name 'flickrClient' is not defined
You are defining
flickrclient
withc
andflickrClient
with capitalC
.So change
flickrclient
toflickrClient
:flickrClient = flickrapi.FlickrAPI(api_key, api_password)