Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python &引用;“禁止”;与twython取得直接信息时_Python_Twitter_Twitter Oauth_Twython - Fatal编程技术网

Python &引用;“禁止”;与twython取得直接信息时

Python &引用;“禁止”;与twython取得直接信息时,python,twitter,twitter-oauth,twython,Python,Twitter,Twitter Oauth,Twython,我正在使用dev.twitter.com上我的应用程序页面上“详细信息”选项卡下显示的令牌、机密和密钥。我有点担心twython称之为app_key,而twitter称之为consumer_key。也许我把事情搞糊涂了 其他调用,如twitter.getFriendsIDs()成功。这可能是密切相关的。我刚刚尝试了twitter.updateStatus(status='asdf'),但出现了一个错误:TwythonError:u'Unauthorized:身份验证凭据丢失或不正确。-只读应用程

我正在使用dev.twitter.com上我的应用程序页面上“详细信息”选项卡下显示的令牌、机密和密钥。我有点担心twython称之为app_key,而twitter称之为consumer_key。也许我把事情搞糊涂了


其他调用,如twitter.getFriendsIDs()成功。

这可能是密切相关的。我刚刚尝试了twitter.updateStatus(status='asdf'),但出现了一个错误:TwythonError:u'Unauthorized:身份验证凭据丢失或不正确。-只读应用程序无法发布'——但是,我已将我的应用程序更改为读写。我在此处找到了答案:
twitter = twython.Twython(oauth_token        = oauth_token,
                          oauth_token_secret = oauth_secret,
                          app_key            = oauth_consumer_key,
                          app_secret         = oauth_consumer_secret)
twitter.getDirectMessages()

TwythonError: 'Forbidden: The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits. -- An error occurred processing your request.'