Python tweepy api.me()不返回好友的用户对象

Python tweepy api.me()不返回好友的用户对象,python,twitter,tweepy,Python,Twitter,Tweepy,因此,从tweepy文档中,我应该能够使用api.me()来获取用户的好友列表: 首先,我跳了通常的OAuth舞: import tweepy consumer_token='#####' consumer_secret='$$$$$' access_token='&&&&&' access_token_secret='****' auth = tweepy.OAuthHandler(consumer_token, consumer_secret) aut

因此,从tweepy文档中,我应该能够使用api.me()来获取用户的好友列表: 首先,我跳了通常的OAuth舞:

import tweepy
consumer_token='#####'
consumer_secret='$$$$$'
access_token='&&&&&'
access_token_secret='****'
auth = tweepy.OAuthHandler(consumer_token, consumer_secret)
auth.set_access_token(access_token,access_token_secret)
api = tweepy.API(auth)
daysinn_friends=api.me('DaysInnCanada')
然后python给了我一个错误,说:

Traceback (most recent call last):
File "<pyshell#40>", line 1, in <module>
daysinn_friend=api.me('DaysInnCanada')
TypeError: me() takes exactly 1 argument (2 given)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
daysinn\u friend=api.me('DaysInnCanada')
TypeError:me()正好接受1个参数(给定2个)
但是我没有将两个参数传递给我(),唯一的参数是屏幕名称。我真的很困惑,弄不明白。谢谢

让您困惑的“额外”参数是Python
self
参数。我已经在中对
self
写了一个很长的解释,所以我不再重复了,我只给你指出那个答案。如果在阅读后,你仍然不明白发生了什么,让我知道,我会看看我是否可以进一步解释


另外,查看tweepy的API文档,
me()
应该不接受任何参数,而您要传递一个参数。通过浏览您的代码,我怀疑您真正想做的是调用
api.followers(“daysincanada”)
。或者可能是
api.get_user(“DaysInnCanada”)
,但我怀疑你是想使用
追随者
OP想要获得他的朋友(即他正在跟踪的人)的列表,而不是跟踪他的人

friends = api.friends_ids('DaysInnCanada')
obj = api.lookup_users(user_ids=friends)
for name in obj:
    print name.screen_name

对于与
关联的所有属性的列表,请使用
名称。

这会导致
tweepy.error.TweepError:[{'message':'查询中指定的术语太多','code':18}]