2012-08-31 37 views
0

我想使用tweepy獲取有關特定用戶屏幕名稱的簡單請求。我這樣做:tweepy unbound method_call錯誤

import tweepy 
api = tweepy.API 
api.get_user('name') 

我得到的錯誤:

unbound method _call() must be called with API instance as first argument (got str instance instead) 

回答

0

您需要創建API的一個實例:

api = tweepy.API() 
api.get_user('name') 

的演示總是更有啓發:

>>> import tweepy 
>>> api = tweepy.API() 
>>> api.get_user('zopatista') 
<tweepy.models.User object at 0x10ffcd910>