1

您好,我正在使用 gtts 语音识别并获取音频来创建像 Alexa 这样的语音助手(这就是我将她命名为 Alex 的原因),并且我正在使用 webbrowser 模块搜索网络。在这里,它打开一个网站,显示我所在位置的天气。有谁知道我如何在一段时间后使用 python 关闭这个选项卡?如果有任何帮助,我正在使用树莓派鸭鸭和铬。谢谢你。

    while True:
          if get_audio() == 'hey Alex':
            search = get_audio()
            if search == 'what is the weather':
                dest='https://weather.com/en-GB/weather/today/l/f71eff26206918c09bd0cf032da3d10774f5f10b16a35a30d41e258cc2397c8e'
                web.get(path).open(dest)
                if get_audio() == 'thank you Alex':
                    text_to_read = 'no problem'
                    reading_from_string()
4

0 回答 0