我收到此错误:
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
对我来说似乎很好。所有的搜索结果最终都是拼写错误,但我的似乎很好(我希望)