_WolFrameAlphaClass.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PYSHA 作者: shafaypro 项目源码 文件源码
def search_engine (self, search_input=""):
        try:
            client = wolframalpha.Client(
                app_id="23XUAT-H2875HHEEX")  # this is the client App id specification for the PYSHA
            results = client.query(search_input)  # this searchs the input from the client side
            answer = next(
                results.results).text  # this gets the String Answered from the Search Engine . so that the answer spoken out by Pysha
            print(answer)
            return answer
        except:
            try:
                results = wikipedia.summary(search_input,
                                            sentences=2)  # this searches for the wikipedia summary input and then parse the input
                print(results)
                return results
            except:
                webbrowser.open(search_input)  # this will open the web browser
                return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号