# -*- coding: utf-8 -*-
import os
import fbconsole
here = os.path.dirname(os.path.abspath(__file__))
def fbfeed():
fbconsole.APP_ID = '588914247790498'
fbconsole.AUTH_SCOPE = ['publish_stream', 'publish_checkins', 'read_stream', 'offline_access']
fbconsole.authenticate()
newsfeed = fbconsole.get('/me/home')
newsfeedData = newsfeed["data"]
for status in newsfeedData:
fromn = [status['from']['name']]
name = [status.get('name', None)]
description = [status.get('description', None)]
if description == name is None:
return fromn
elif description is None:
return fromn.extend(name)
elif name is None:
return fromn.extend(description)
else:
return fromn + name + description
我的代码只返回一个字符串,但是当我使用打印,而不是回报 - 它打印所有结果的。我如何返回相同的结果,如print?如何返回的所有字符串
改变你返回的收益,那么你可以''为f在饲料():'' – sotapme 2013-02-11 18:40:15