auth = tweepy.BasicAuthHandler("username", "password") api = tweepy.API(auth) auth = tweepy.OAuthHandler("consumer_key", "consumer_secret") # Redirect user to Twitter to authorize redirect_user(auth.get_authorization_url()) # Get access token auth.get_access_token("verifier_value") # Construct the API instance api = tweepy.API(auth) # Iterate through all of the authenticated user's friends for fri