我得到这个错误:我得到一个定义的错误,即使一切似乎是罚款
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