0
在tweepy streamListener中,“def on_data(self,data):”和“def on_status(self,status):”有什么区别?在tweepy streamListener中,“def on_data(self,data):”和“def on_status(self,status):”有什么区别?
喜,在tweepy documentation 他们使用高清on_status流媒体:
import tweepy
class MyStreamListener(tweepy.StreamListener):
def on_status(self, status):
print(status.text)
但this tutorial使用高清on_data流媒体:
from tweepy import Stream
from tweepy.streaming import StreamListener
class MyListener(StreamListener):
def on_data(self, data):
的区别是什么?
只是说明一下,当一个字段表示“在此处输入链接描述”时,系统会要求您实际输入内容,而不是仅保留默认文本;-) –