Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9292831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:58:35+00:00 2026-06-18T20:58:35+00:00

# -*- coding: utf-8 -*- import os import fbconsole here = os.path.dirname(os.path.abspath(__file__)) def fbfeed():

  • 0
# -*- 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

My code returns only one string, but when I use print instead of return – it prints ALL of results. How can I return the same results, as in case of print??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T20:58:36+00:00Added an answer on June 18, 2026 at 8:58 pm

    When you use return it exits the function and doesn’t keep iterating through the loop like it does with print. Try yield.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my code #!/usr/bin/python # -*- coding:utf-8 -*- import sys import pysvn def
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import cgi import string
I have a script like this: #!/Python26/ # -*- coding: utf-8 -*- import sys
I have this code: # -*- coding: utf-8 -*- import random import os, glob
I have this code: # -*- coding: utf-8 -*- import random import os, glob
I currently have the following snippet: #!/usr/bin/python # -*- coding: utf-8 -*- import numpy
# -*- coding: utf-8 -*- import os import time import re import urllib import
Minimum example: # -*- coding: utf-8 -*- import requests xml = <?xml version='1.0' encoding='utf-8'?>
I have written the following Python code: #!/usr/bin/python # -*- coding: utf-8 -*- import
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from PyQt4 import QtGui, QtCore class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.