2016-06-08 85 views
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): 

的區別是什麼?

+0

只是說明一下,當一個字段表示「在此處輸入鏈接描述」時,系統會要求您實際輸入內容,而不是僅保留默認文本;-) –

回答

0

閱讀第一個鏈接。 「差異」是一個發生在另一個之前。

Tweepy的StreamListener的on_data方法方便地將數據從狀態傳遞到on_status方法。

相關問題