我得到這個錯誤:我得到一個定義的錯誤,即使一切似乎是罰款
Traceback (most recent call last):
File "C:\Python27\botid.py", line 23, in <module>
fiList = {msg:submission.ups + len(coList)}
NameError: name 'coList' is not defined
此:
wbcWords = ['wbc', 'advice', 'prc','server']
while True:
subreddit = r.get_subreddit('MCPE')
for submission in subreddit.get_hot(limit=30):
op_text = submission.title.lower()
has_wbc = any(string in op_text for string in wbcWords)
# Test if it contains a WBC-related question
if submission.id not in already_done and has_wbc:
msg = '[WBC related thread](%s)' % submission.short_link
comments = submission.comments
for comment in comments:
coList = [comment.author.name]
fiList = {msg:submission.ups + len(coList)}
print fiList
似乎沒什麼問題。所有的搜索結果最終都是拼寫錯誤,但我看起來很好(我希望)
啊不,它應該只檢查一次,但這並不是什麼大問題。我試圖在for循環之前定義它,但我仍然得到相同的錯誤。 – user2374668 2013-05-12 10:33:28