# -*- 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而不是return 时- 它会打印所有结果。如何返回与print相同的结果?