首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Flickr streaming python getcomment()

Flickr streaming python getcomment()
EN

Stack Overflow用户
提问于 2014-09-27 22:56:34
回答 1查看 89关注 0票数 0

在用于flickr流的python库flickr中,getcomment()方法不返回注释。下面是这些方法

代码语言:javascript
复制
def getComments(self):
    """"
    get list of comments for photo
    returns a list of comment objects
    comment text is in return [item].text
    """
    method = "flickr.photos.comments.getList"
    try:
        data = _doget(method,  photo_id=self.id)
    except FlickrError: # ???? what errors might there be????
        return None
    return data.rsp.comments

输出为

代码语言:javascript
复制
<flickr.Bag instance at 0x03F9D378>
8532177364
<flickr.Bag instance at 0x03459828>
8528705440
<flickr.Bag instance at 0x0359B620>
8524405870
<flickr.Bag instance at 0x02D5E1C0>
8521650007
<flickr.Bag instance at 0x02C4CE90>
8519752817
<flickr.Bag instance at 0x02C4CBC0>
EN

回答 1

Stack Overflow用户

发布于 2014-09-27 23:42:51

尝试这个(未测试)

代码语言:javascript
复制
comments = photo.getComments()  # Replace photo with name of your object
for comment in comments : 
    print comment.text
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26075946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档