【发布时间】:2019-04-17 22:56:49
【问题描述】:
我正在尝试使用带有wincl 的内置语音系统的线程。
但是我遇到了这个错误:
pywintypes.com_error: (-2147221008, 'CoInitialize 尚未被调用。', None, None)
我似乎无法破译。
这是我的代码:
import win32com.client as wincl
import time, threading
def ten_second_timer():
t =threading.Timer(10, ten_second_timer)
speak = wincl.Dispatch("SAPI.SpVoice")
speak.Speak("10 seconds have passed")
t.start()
t =threading.Thread(target = ten_second_timer)
t.start()
【问题讨论】:
标签: python multithreading win32com sapi