简体   繁体   中英

Speech Recognition module is giving a dictionary as well as a list. Any solutions?

I tried to run the code. It worked very well but leaving a dictionary after being executed.

This is the code: Code for the wishMe function which is executed at the starting of the program

It seems you make use of the package SpeechRecognition .

On line 54 of main.py you call r.recognize_google() . Looking at the source code of this method, on line 917 and 918 it shows that the authors of the package print the results when the method is called.

Unfortunately there is no easy way to suppress print statements in imported code. If it really bothers you, you can modify stdout like they suggest in this thread. Or you can fork the repository and change the source code so results only print when you want to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM