0

我正在尝试使用 python 构建语音助手。但我有一些问题。

我有一个包含单词的 assistantInputs.py 文件,以及主程序的 main.py。

这是我在 assistantInputs.py 中的代码:

hello = ["hi","hey","hello","greetings"]

这是我在 main.py 中的代码:

import assistantInputs as aI

if voice_data in aI.hello:
    print("Hey!")

'voice_data' 允许我说话和识别我的声音。

但它不起作用。我应该做些什么?我无法访问hello列表。

4

0 回答 0