Python3.5环境安装及使用 Speech问题解决(转)
修改speech.py
line59 修改import thread,改成import threading
line157 修改print prompt,改成print(prompt)
对最后的函数_ensure_event_thread修改如下:见加粗字体
增加class类 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替换为下面两行; _eventthread = T()
_eventthread.start()
如果提示如下报错:见图

执行pip install pypiwin32进行安装
Python3.5环境安装及使用 Speech问题解决(转)的更多相关文章
- linux系统,python3.7环境安装talib过程
获取源码wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz 解压进入目录tar -zxvf ta-lib-0. ...
- python3.7环境安装
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libffi-devel-3.0.5-3.2.el6.x86_64.rpm rpm ...
- Python3源代码编译安装
Python3源代码编译安装 安装必要工具 yum-utils ,它的功能是管理repository及扩展包的工具 (主要是针对repository) $ sudo yum install yum-u ...
- Python3.5环境下安装wxPtyhon
Win7系统下,Python3.5环境下安装wxPtyhon, 已成功安装并运行. 1.先从下面网站下载对应的whl版本. https://wxpython.org/Phoenix/snapshot- ...
- Oracle-Linux安装配置python3.6环境
最近公司更换了linux系统的版本,从Ubuntu改为了oracle linux,相关的Python环境也要重新配置,记录一下基本配置的过程. 相关环境 系统:oracle linux7.3 系统自带 ...
- python3爬虫_环境安装
一.环境安装 1.python3安装 官网:https://www.python.org/downloads/ 64 位系统可以下载 Windows x86-64 executable install ...
- Linux学习5-CentOS安装Python3.6环境和pip3
前言 centos7 自带有 python,但是却是 python2 版本的 python,如果你想安装个python3怎么办呢? 如果直接删除python2的话,可能会引起其他的问题,因为有些东西是 ...
- debian+python3.5环境下安装paramiko模块:
debian+python3.5环境下安装paramiko模块: 1.确保安装了操作系统安装了libssl-dev,zlib1g-dev (redhat,centos下这两包包名为openssl-d ...
- 在Ubuntu 16.04 安装python3.6 环境并设置为默认
在Ubuntu 16.04 安装python3.6 环境并设置为默认 1.添加python3.6安装包,并且安装 sudo apt-get install software-properties-co ...
随机推荐
- checklist和基础安全知识
checklist和基础安全知识 https://book.yunzhan365.com/umta/rtnp/mobile/index.html 网络安全科普小册子 http://sec.cuc.ed ...
- prometheus部署安装
1. 下载&部署 # 下载 [root@prometheus src]# cd /usr/local/src/ [root@prometheus src]# wget https://gith ...
- IDEA使用mybatis generator自动生成代码
主要就三步: 1.pom 文件中引入jar包并配置 build 属性 <dependencies> <!-- 自动生产mapper Begin! --> <depende ...
- C#实现排列、组合
排列组合的概念 排列:从n个不同元素中取出m(m≤n)个元素,按照一定的顺序排成一列,叫做从n个元素中取出m个元素的一个排列(Arrangement). 组合:从m个不同的元素中,任取n(n≤m)个元 ...
- pytorch安装问题
目录 1.版本 2.pytorch调试中出现的Module 'torch' has no 'zero' member如何解决 3.No module named 'numpy.core._multia ...
- 《你必须知道的495个C语言问题》读书笔记之第15-20章:浮点数、风格、杂项
一.可变参数列表 1. Q:为什么调用printf前必须要包含<stdio.h>? A:为了把printf的正确原型说明引入作用域.例如,如果可变参数的调用比固定参数的调用效率低,编译器就 ...
- oracle建表字段包含关键字注意事项
SQL建表时最好不要把表定义成关键字字段 1 若不小心把表定义成关键字了,比如option, desc等等,oracle版本查询会有问题,短期内无法修改字段名称的,暂时用字段名+双引号解决: SELE ...
- springboot @vaule注解失效解决办法
在Controller类里面通过@Value将参数注入进来,最后的确成功了.因此基于此经验,我便在其他使用的类里面也采用这样的方式注入参数,但是发现去失效了,报错为NULL,说明参数并没有我们料想的被 ...
- (四)mybatis 的主键返回
目录 文章目录 自增主键(LAST_INSERT_ID()) 非自增主键(UUID() ) 自增主键(LAST_INSERT_ID()) 在映射关系文件中配置 <!--插入用户--> &l ...
- 数据结构:BF算法
贴上源代码: #include<iostream> using namespace std; int BF(char S[],char T[]) { int i,j; i = j = 0; ...