Python3.5 environment Installation and use speech problem solving __python

Source: Internet
Author: User

Modify speech.py

line59 Modify import thread and change to import threading

line157 Modify print prompt, change to print (prompt)


The final function _ensure_event_thread is modified as follows:



Class T (threading. Thread):
def __init__ (self):
Threading. Thread.__init__ (self)
def run (self):
Pass

Def _ensure_event_thread ():
"""
Make sure the Eventthread is running, which checks the Handlerqueue
For new eventhandlers to create, and runs the message pump.
"""
Global _eventthread
If not _eventthread:
def loop ():
While _eventthread:
Pythoncom. Pumpwaitingmessages ()
If _handlerqueue:
(context,listener,callback) = _handlerqueue.pop ()
# Just Creating a _listenercallback object makes events
# Fire till listener loses reference to its grammar object
_listenercallback (context, listener, callback)
Time.sleep (. 5)
_eventthread = T ()
_eventthread.start ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.