speech2scpi.py 文件源码

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

项目:speech2scpi 作者: patricksebastien 项目源码 文件源码
def evaluate(calling):
    c = str(text.get("1.0",END)).strip()
    for result in results:
                print('Trying to connect to {}...'.format(socket.inet_ntoa(result['zc_info'].address)))
                scpi_connection = get_scpi_connection_tuple((socket.inet_ntoa(result['zc_info'].address), result['zc_info'].port))

                if scpi_connection is not (None, None):
                    if any("?" in s for s in c):
                        rs = receive_scpi(scpi_connection, c)
                        textb.delete("1.0", END)
                        if strType(rs) == "float":
                            t = str(float(rs))
                        else:
                            t = str(rs)
                        textb.insert(END, t)
                        if ttsenabled.get():
                            thread.start_new_thread(tts, (t,))
                    else:
                        send_scpi(scpi_connection, str(text.get("1.0",END)).strip())
    text.delete("1.0", END)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号