我想我将“api”定义为 twitter.api,我不知道为什么会发生此错误代码:
import twitter
def auth():
api = twitter.Api(consumer_key='CsqkkrnhBZQMhGLpnkqGqOUOV',
consumer_secret='jzbWgRLZqIyJQjfh572LgbtuifBtXw6jwm1V94oqcQCzJd7VAE',
access_token_key='1300635453247361031-EWTTGf1B6T2GUqWmFwzLfvgni3PoVH',
access_token_secret='U2GZsWT0TvL5U24BG9X4NDAb84t1BB059qdoyJgGqhWN4')
auth()
api.PostUpdate('Hello World')
错误:
Traceback (most recent call last):
File "C:/Users/Xtrike/AppData/Local/Programs/Python/Python37/twitter python.py", line 11, in <module>
api.PostUpdate('Hello World')
NameError: name 'api' is not defined
Smart猫小萌
慕容森
相关分类