Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple gets from JSON?
#2
Quote:I was wondering how could I change line 28 so that I can pick out specific items I want to get, specifically just pk, username, and full name?

I think what your looking for is this?

def get_Followers(user):
    next_max_id = True

    while next_max_id:
        if next_max_id == True:
            next_max_id = ''
            API.getUserFollowings(get_userID(user), maxid=next_max_id)
            followers = API.LastJson.get('users', []) 

            if type(followers) is list:
                for follower in followers:
                    following.append((follower['pk'],
                                      follower['username'],
                                      follower['full_name']
                                      )
                                    )   
            next_max_id = API.LastJson.get('next_max_id', '') 
Reply


Messages In This Thread
Multiple gets from JSON? - by alex36540 - Jan-03-2018, 09:40 PM
RE: Multiple gets from JSON? - by hshivaraj - Jan-04-2018, 04:19 PM
RE: Multiple gets from JSON? - by alex36540 - Jan-04-2018, 11:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to generating multiple json files using python script dzgn989 4 264 May-10-2024, 03:09 PM
Last Post: deanhystad
  geojson to json --missing multiple row output yoshi 9 2,932 Mar-06-2022, 08:34 PM
Last Post: snippsat
  Parse JSON multiple objects larkin_L 8 5,901 May-27-2020, 11:18 AM
Last Post: nuffink
  print python json dump onto multiple lines lhailey 2 20,055 Mar-02-2020, 12:47 PM
Last Post: vishalhule
  Download multiple large json files at once halcynthis 0 2,822 Feb-14-2019, 08:41 AM
Last Post: halcynthis
  Write lambda function in pyhhon to coy data from multiple JSON into a single JSON fil anandmn85 2 4,286 Apr-19-2018, 05:56 AM
Last Post: anandmn85

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020