Barry Barry - 5 months ago 64
Python Question

How to get screen name instead of user ID with tweepy

I'm printing out the tweets from my twitter feed to a CSV and want to get the CSV to show the username instead of the user ID.

My code uses tweepy.

outtweets.append([tweet.id_str, tweet.created_at, tweet.text.encode("utf-8")])

This is what I use in my loop to get the user ID.
How would I go about to get the screen name instead?


See Tweet object and User object.

This will reveal that you need to use:

to access the user name