我試圖執行這個代碼,我得到這個錯誤信息:NameError:名字「process_or_store」沒有定義,蟒蛇
NameError: name 'process_or_store' is not defined,
我嘗試了所有相關的解決方案在這裏並沒有什麼工作。我如何擺脫錯誤信息?
import tweepy
import json
import nltk
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
consumer_key = 'key'
consumer_secret = 'secret'
access_token = '-token'
access_secret = 'secret'
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
api = tweepy.API(auth)
for status in tweepy.Cursor(api.home_timeline).items(10):
# Process a single status
process_or_store(status.json)
你在哪裏定義你的'process_or_store'方法? –
那我該如何解決呢? –
...定義它?你認爲'process_or_store'從哪裏來的? – jonrsharpe