-2
當我在(https://pypi.python.org/pypi/twitter)頁面上運行示例時,出現以下錯誤。有任何想法嗎?謝謝。twitter OAuth錯誤
from twitter import *
t = Twitter(auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET,CONSUMER_KEY, CONSUMER_SECRET))
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-a7d2f82e2d8f> in <module>()
1 t = Twitter(
----> 2 auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET,
3 CONSUMER_KEY, CONSUMER_SECRET))
NameError: name 'OAUTH_TOKEN' is not defined
只是一個瘋狂的猜測,但你有沒有定義'OAUTH_TOKEN'和其餘的常量? – MattDMo