Twython get_retweets方法给出数字或参数错误

问题描述 投票:0回答:1

[我正在尝试复制this SO question中显示的示例,但我在看起来像Twython错误的地方,绊绊,不胜感激]]

这里是代码:

status_id = <some_status_id>
response = twitter.get_retweets(status_id, 100)

导致以下错误

TypeError: get_retweets() takes 1 positional argument but 3 were given

我试图像没有参数一样运行

response = twitter.get_retweets() 

然后我从Twitter收到一条错误消息:>

twython.exceptions.TwythonError: Twitter API returned a 404 (Not Found), Sorry, that page does not exist

这是错误吗?

我正在尝试复制此SO问题中显示的示例,并且我在绊倒Twython错误的过程中感到困惑,不胜感激,这是代码:status_id = ...

python-3.x twitter twython
1个回答
1
投票
已解决,status_id必须作为命名参数传递

status_id = <some_status_id> response = twitter.get_retweets(id=status_id) # 100 is already the max available

© www.soinside.com 2019 - 2024. All rights reserved.