python - can you use pydictionary in google app engine? -
i'm trying use pydictionary in google app engine application error. don't error when use outside google application. i've added third party library (properly) imports without errors don't know why.
here's error:
searching.py", line 63, in getkey assert isinstance(word.keys, object) attributeerror: 'nonetype' object has no attribute 'keys' and here's code function:
def getkey(term): dictionary = pydictionary() word = dictionary.meaning(term) assert isinstance(word.keys, object) results = word.keys() newresults = [] result in results: newresults.append(str(result)) return newresults[0] it works outside app engine project, not inside...
you should go , @ exception , try , understand telling you.
searching.py", line 63, in getkey assert isinstance(word.keys, object) attributeerror: 'nonetype' object has no attribute 'keys' let's trace through code.
for error occur means value referred word none.
this means result of word = dictionary.meaning(term)
is none.
so should therefore @ value of term is.
are validating term meaningful anywhere ? if is, expected result of dictionary.meaning(term) , investigate why don't expected result.
some basic debugging go long way here, helping diagnose issue.
Comments
Post a Comment