我正在使用WolframAlpha应用编程接口。在我尝试得到问题的结果之前,一切都很好。当我问它“生命的意义是什么”而不是给我42的程序时,它给了我“42 s”……不太确定为什么,有人能帮上忙吗?
这是我的代码:
import wolframalpha
client= wolframalpha.Client("**myappid**")
z = "What is the meaning of life?"
res = client.query(z)
try:
print (next(res.results).text)
except StopIteration:
print ("No results")发布于 2018-04-23 03:27:03
试试这个:
import wolframplha
app_id = "your app id"
client = wolframalpha.Client(app_id)
res = client.query(input)
answer = next(res.results).text #to make sure wolramalpha gives answer in text and not in graph and all
print(answer)https://stackoverflow.com/questions/45088218
复制相似问题