【发布时间】:2015-06-10 12:56:43
【问题描述】:
在这里,Limit tweepy stream to a specific number,我尝试使用 tweepy 停止流式传输脚本,但一直出错。我尝试修复某些人可能建议的错误,但没有运气。
我想到了另一种可能根据打印输出数量终止脚本的方法。我所做的是将前面的代码放入一个函数中:
def streamer(location):
## same code here ##
twitterStream.filter(locations=[\location) ## changed to match function##
然后我会调用函数(即streamer(LA)),其中 LA 是用一组坐标预定义的。
我的问题:是否可以根据其输出的数字终止函数streamer 而无需更改函数本身(由于持续错误)?
【问题讨论】:
标签: python python-3.x tweepy twitter-streaming-api