I created a list on twitter and added a user to it. Then I finally figured out how to write the code without an error. I am a newbie. Then Lo and behold when i get data it is whacked out. I have no idea what to do with it.
All I want is to get the usernames of everyone in the the list.
Here is the code:
the_list = api.list_members('username', 'listname')
for user in the_list:
print user
Here is what I get:
tweepy.models.User object at 0x90b78ec
(0, 0)
That doesn’t look like list_members to me.
I want to create a normal python list of just the usernames.
Thanks for any help.
Each element of the list is a
Userobject, which holds more information about the user than just their name. If you want just the names, doafter calling
api.list_members. Or you can combine the two:or you can extract the names only when you’re displaying them:
Incidentally, you should choose a more informative name than
the_list. Perhapsuser_namesorlist_membersor something.