本文整理汇总了Python中flickrapi.FlickrAPI.people_getInfo方法的典型用法代码示例。如果您正苦于以下问题:Python FlickrAPI.people_getInfo方法的具体用法?Python FlickrAPI.people_getInfo怎么用?Python FlickrAPI.people_getInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flickrapi.FlickrAPI
的用法示例。
在下文中一共展示了FlickrAPI.people_getInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from flickrapi import FlickrAPI [as 别名]
# 或者: from flickrapi.FlickrAPI import people_getInfo [as 别名]
# save the set for later
neighbor_sets[contact_nsid] = friendcontactset
neighbor_num_shared[contact_nsid] = len(sharedcontactset)
neighbor_weighted[contact_nsid] = float(len(sharedcontactset)) / (len(mycontactset) + len(friendcontactset))
print "%s\ttotal: %d shared: %d weighted: %f" % (contact_nsid, len(friendcontactlist), len(sharedcontactset), neighbor_weighted[contact_nsid] )
#nextdoor = sorted(neighbor_num_shared.items(), key=itemgetter(1), reverse=True)
nextdoor = sorted(neighbor_weighted.items(), key=itemgetter(1), reverse=True)
output = []
#(a,b,c) = ( sets.Set(), sets.Set(), sets.Set() )
a = mycontactset
b = neighbor_sets[ nextdoor[0][0] ]
c = neighbor_sets[ nextdoor[1][0] ]
user_a = user
#userb
rsp = fapi.people_getInfo(api_key=apikey_flickr,user_id=nextdoor[0][0])
fapi.testFailure(rsp)
user_b = rsp.person[0].username[0].elementText
#userc
rsp = fapi.people_getInfo(api_key=apikey_flickr,user_id=nextdoor[1][0])
fapi.testFailure(rsp)
user_c = rsp.person[0].username[0].elementText
# Supply one data set where:
# * The first three values specify the relative sizes of three circles: A, B, and C.
chd = [ len(a), len(b), len(c) ]
# * The fourth value specifies the area of A intersecting B.
chd.append( len( a.intersection(b) ) )
# * The fifth value specifies the area of A intersecting C.
chd.append( len ( a.intersection(c) ) )
# * The sixth value specifies the area of B intersecting C.