Python-twitter api.VerifyCredentials() 返回 none

标签 python twitter python-twitter

我正在使用 python-twitter api,我得到了 consumer_key、c​​onsumer_secret、access_token_key、access_token_secret 但是当我尝试下面的代码时,我得到了这个输出 {} for print api.VerifyCredentials() 但我没有对于 print status.text

import twitter

api = twitter.Api(consumer_key='**',
                      consumer_secret='**',
                      access_token_key='**',
                      access_token_secret='**')

print api.VerifyCredentials() #returns {}
status = api.PostUpdate('Ilovepython-twitter!')
print status.text #returns none

你认为这里有什么问题?

最佳答案

这里的问题肯定是库“twitter”。不要导入“twitter”,而是使用“tweepy”,它会起作用。

关于Python-twitter api.VerifyCredentials() 返回 none,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17797730/

相关文章:

python - Pyserial 格式 - 超过 127 的字节返回为 2 个字节,而不是一个

python - 防止使用 python 复制或修改 pdf 文件

python - PyCharm + flask : Unresolved reference - How do I properly import Python namespaces?

python twitter api 每秒返回的推文数量不一致

python - 不循环的 Numpy 矩阵和

Android 在 Twitter 上的分享

python - 使用 Twitter 的 Streaming API 时更改 POST 请求参数

selenium - FunCaptcha回调函数中如何提交token?

python - 如何在 Python 中使用 Twitter API 更快地收集推文?

python-3.x - python-twitter异常处理